// leadContext)).useAsyncMessaging(correlator)
// .setAsyncResponseTimeoutInMs(33000L); // to simplify testing
//FIXME Chathura
//This was done to mitigate the issue in the duel network cards.
WsdlDefinitions proxyWSDL = xsul5.wsdl.WsdlResolver.getInstance().loadWsdl(engineURL);
// WsdlService proxyService = WSDLUtil.getfirst(proxyWSDL.services());
// WsdlPort proxyPort = WSDLUtil.getfirst(proxyService.ports());
// org.xmlpull.infoset.XmlElement address = proxyPort.xml().element("address");
// XmlAttribute location = address.attribute("location");
// address.removeAttribute(location);
// address.setAttributeValue("location", engineURL.toString().substring(0, engineURL.toString().indexOf("?wsdl")));
// WSIFService service = WSIFServiceFactory.newInstance().getService(
// WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(proxyWSDL) );
// WSIFPort port = service.getPort();
// WSIFClient wclient = WSIFRuntime.getDefault().newClientFor(port);
WSIFClient wclient = WSIFRuntime.newClient(engineURL.toString())
.addHandler(
new StickySoapHeaderHandler("use-lead-header",
leadContext)).useAsyncMessaging(correlator)
.setAsyncResponseTimeoutInMs(33000L); // to simplify testing
// set to just few
// seconds
WSIFPort port = wclient.getPort();
WSIFOperation operation = port.createOperation("deploy");
WSIFMessage outputMessage = operation.createOutputMessage();
WSIFMessage faultMessage = operation.createFaultMessage();
XmlElement inputMessageElement = xmlObjectToEl(getDeploymentPayload(
workflow, this.xbayaEngine.getConfiguration().getDSCURL()));
WSIFMessage inputMessage = new WSIFMessageElement(
inputMessageElement);
System.out.println("Sending a message:\n"
+ XMLUtil.xmlElementToString((XmlElement) inputMessage));
boolean success = operation.executeRequestResponseOperation(
inputMessage, outputMessage, faultMessage);
XmlElement result;
if (success) {
result = (XmlElement) outputMessage;
} else {
throw new XsulException(faultMessage.toString());
}
} catch (IOException e) {
throw new WorkflowProxyException(e);
} catch (XmlBuilderException e) {
throw new WorkflowProxyException(e);
} catch (GraphException e) {
throw new WorkflowProxyException(e);
} catch (ComponentException e) {
throw new WorkflowProxyException(e);
}
XBayaConfiguration configuration = this.xbayaEngine.getConfiguration();
WsdlDefinitions workflowWSDL;
try {
workflowWSDL = workflow.getOdeWorkflowWSDL(configuration
.getDSCURL(), configuration.getODEURL());
} catch (Exception e) {
// shouldnt happen cos we have already called this once
throw new XBayaRuntimeException(e);
}
org.xmlpull.infoset.XmlElement service = workflowWSDL.xml().element(
null, "service");
org.xmlpull.infoset.XmlElement port = service.element(null, "port");
org.xmlpull.infoset.XmlElement address = port.element(null, "address");
String location = address.attributeValue("location");