use of xsul.wsdl.WsdlDefinitions in project airavata by apache.
the class GFacServiceCreator method createService.
/**
* @param serviceQName
* @return The WSDL definitions of the service created.
* @throws WorkflowException
*/
public WsdlDefinitions createService(String serviceQName) throws WorkflowException {
logger.debug(serviceQName);
try {
WSIFMessage inputMessage = this.gFacOperation.createInputMessage();
WSIFMessage outputMessage = this.gFacOperation.createOutputMessage();
WSIFMessage faultMessage = this.gFacOperation.createFaultMessage();
inputMessage.setObjectPart(SERVICE_QNAME_PART, serviceQName);
inputMessage.setObjectPart(SECURITY_PART, SECURITY_NONE);
logger.debug("inputMessage: " + inputMessage);
boolean success = this.gFacOperation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
if (!success) {
// An implementation of WSIFMessage, WSIFMessageElement,
// implements toString(), which serialize the message XML.
String message = "Failed to create a service: " + faultMessage.toString();
throw new WorkflowException(message);
}
String wsdl = (String) outputMessage.getObjectPart(WSDL_PART);
logger.debug("WSDL: " + wsdl);
XmlElement definitionsElement = XMLUtil.stringToXmlElement3(wsdl);
this.serviceDefinitions = new WsdlDefinitions(definitionsElement);
return this.serviceDefinitions;
} catch (RuntimeException e) {
String message = "Failed to create a service";
throw new WorkflowException(message, e);
}
}
Aggregations