Search in sources :

Example 1 with WsdlDefinitions

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);
    }
}
Also used : WsdlDefinitions(xsul.wsdl.WsdlDefinitions) WorkflowException(org.apache.airavata.workflow.model.exceptions.WorkflowException) XmlElement(org.xmlpull.v1.builder.XmlElement) WSIFMessage(xsul.wsif.WSIFMessage)

Aggregations

WorkflowException (org.apache.airavata.workflow.model.exceptions.WorkflowException)1 XmlElement (org.xmlpull.v1.builder.XmlElement)1 WsdlDefinitions (xsul.wsdl.WsdlDefinitions)1 WSIFMessage (xsul.wsif.WSIFMessage)1