public ESBConsumer createConsumer(final ESBEndpointInfo endpoint) {
System.out.println("ESB [consumer]: Creating a consumer to communicate with service " + endpoint.getEndpointProperties().get("wsdlURL"));
System.out.println("ESB [consumer]: consumer endpoint info - key = " + endpoint.getEndpointKey());
System.out.println("ESB [consumer]: consumer endpoint info - uri = " + endpoint.getEndpointUri());
System.out.println("ESB [consumer]: consumer endpoint info - properties = " + endpoint.getEndpointProperties());
return new ESBConsumer() {
public Object invoke(Object payload) throws Exception {
// System.out.println("ESB: Job sent message " + ((org.dom4j.Document) payload).asXML());
System.out.println("ESB [consumer]: Job sent message to " + endpoint.getEndpointProperties().get("wsdlURL"));
try {Thread.sleep(1000);} catch (InterruptedException e) {}
return getDocument("<GetWeatherResponse xmlns='http://litwinconsulting.com/webservices/'><GetWeatherResult>Sunny</GetWeatherResult></GetWeatherResponse>");