*/
public void test() throws WsdlException, XBayaException {
// WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(
// new File(SAMPLE_AWSDL).toURI());
AdderService service = new AdderService();
service.run();
WsdlDefinitions definitions = WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(service.getWsdl());
if (WSDLUtil.isAWSDL(definitions)) {
DSCUtil.convertToCWSDL(definitions, this.configuration.getDSCURL());
}
logger.info(definitions.xmlStringPretty());
// Create lead context.
LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
leadContextHelper.setXBayaConfiguration(this.configuration);
LeadContextHeader leadContext = leadContextHelper.getLeadContextHeader();
URI messageBoxURL = null;
if (this.configuration.isPullMode()) {
messageBoxURL = this.configuration.getMessageBoxURL();
}
LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(definitions, leadContext, messageBoxURL);
List<WSComponentPort> inputs = invoker.getInputs();
for (WSComponentPort input : inputs) {
String name = input.getName();
logger.info("name: " + name);
input.setValue("200");
org.xmlpull.infoset.XmlElement appinfo = input.getAppinfo();
logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
}
invoker.setInputs(inputs);
boolean success = invoker.invoke();
logger.info("success: " + success);
if (success) {
List<WSComponentPort> outputs = invoker.getOutputs();
for (WSComponentPort output : outputs) {
String name = output.getName();
logger.info("name: " + name);
Object value = output.getValue();
logger.info("value: " + value);
}
} else {
WSIFMessage fault = invoker.getFault();
logger.info("fault: " + fault);
}
service.shutdownServer();
}