Search in sources :

Example 1 with BindingOutput

use of javax.wsdl.BindingOutput in project tdi-studio-se by Talend.

the class ComponentBuilder method buildOperation.

private OperationInfo buildOperation(OperationInfo operationInfo, BindingOperation bindingOper) {
    Operation oper = bindingOper.getOperation();
    operationInfo.setTargetMethodName(oper.getName());
    Vector operElems = findExtensibilityElement(bindingOper.getExtensibilityElements(), "operation");
    ExtensibilityElement operElem = (ExtensibilityElement) operElems.elementAt(0);
    if (operElem != null && operElem instanceof SOAPOperation) {
        SOAPOperation soapOperation = (SOAPOperation) operElem;
        operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
    } else if (operElem != null && operElem instanceof SOAP12Operation) {
        SOAP12Operation soapOperation = (SOAP12Operation) operElem;
        operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
    }
    BindingInput bindingInput = bindingOper.getBindingInput();
    BindingOutput bindingOutput = bindingOper.getBindingOutput();
    Vector bodyElems = findExtensibilityElement(bindingInput.getExtensibilityElements(), "body");
    ExtensibilityElement bodyElem = (ExtensibilityElement) bodyElems.elementAt(0);
    if (bodyElem != null && bodyElem instanceof SOAPBody) {
        SOAPBody soapBody = (SOAPBody) bodyElem;
        List styles = soapBody.getEncodingStyles();
        String encodingStyle = null;
        if (styles != null) {
            encodingStyle = styles.get(0).toString();
        }
        if (encodingStyle == null) {
            encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
        }
        operationInfo.setEncodingStyle(encodingStyle.toString());
        operationInfo.setTargetObjectURI(soapBody.getNamespaceURI());
    } else if (bodyElem != null && bodyElem instanceof SOAP12Body) {
        SOAP12Body soapBody = (SOAP12Body) bodyElem;
        String encodingStyle = null;
        if (soapBody.getEncodingStyle() != null) {
            encodingStyle = soapBody.getEncodingStyle().toString();
        }
        if (encodingStyle == null) {
            encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
        }
        operationInfo.setEncodingStyle(encodingStyle.toString());
        operationInfo.setTargetObjectURI(soapBody.getNamespaceURI());
    }
    Input inDef = oper.getInput();
    if (inDef != null) {
        Message inMsg = inDef.getMessage();
        if (inMsg != null) {
            operationInfo.setInputMessageName(inMsg.getQName().getLocalPart());
            getParameterFromMessage(operationInfo, inMsg, 1);
            operationInfo.setInmessage(inMsg);
        }
    }
    Output outDef = oper.getOutput();
    if (outDef != null) {
        Message outMsg = outDef.getMessage();
        if (outMsg != null) {
            operationInfo.setOutputMessageName(outMsg.getQName().getLocalPart());
            getParameterFromMessage(operationInfo, outMsg, 2);
            operationInfo.setOutmessage(outMsg);
        }
    }
    return operationInfo;
}
Also used : SOAPOperation(javax.wsdl.extensions.soap.SOAPOperation) BindingOutput(javax.wsdl.BindingOutput) SOAP12Body(javax.wsdl.extensions.soap12.SOAP12Body) Message(javax.wsdl.Message) Operation(javax.wsdl.Operation) SOAP12Operation(javax.wsdl.extensions.soap12.SOAP12Operation) BindingOperation(javax.wsdl.BindingOperation) SOAPOperation(javax.wsdl.extensions.soap.SOAPOperation) BindingInput(javax.wsdl.BindingInput) UnknownExtensibilityElement(javax.wsdl.extensions.UnknownExtensibilityElement) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement) SOAPBody(javax.wsdl.extensions.soap.SOAPBody) Input(javax.wsdl.Input) BindingInput(javax.wsdl.BindingInput) SOAP12Operation(javax.wsdl.extensions.soap12.SOAP12Operation) BindingOutput(javax.wsdl.BindingOutput) Output(javax.wsdl.Output) List(java.util.List) ArrayList(java.util.ArrayList) Vector(java.util.Vector)

Example 2 with BindingOutput

use of javax.wsdl.BindingOutput in project carbon-business-process by wso2.

the class SOAPUtils method parseSOAPResponseFromPartner.

public static org.apache.ode.bpel.iapi.Message parseSOAPResponseFromPartner(BPELMessageContext partnerInvocationContext, MessageExchange partnerRoleMessageExchange) throws BPELFault {
    org.apache.ode.bpel.iapi.Message messageToODE = partnerRoleMessageExchange.createMessage(partnerRoleMessageExchange.getOperation().getOutput().getMessage().getQName());
    BindingOperation bindingOp = getBindingOperation(partnerInvocationContext, partnerRoleMessageExchange.getOperationName());
    BindingOutput bindingOutPut = getBindingOutPut(bindingOp);
    SOAPEnvelope responseFromPartnerService = partnerInvocationContext.getOutMessageContext().getEnvelope();
    if (partnerInvocationContext.isSoap12()) {
        javax.wsdl.extensions.soap12.SOAP12Body soapBodyDefinition = getSOAP12Body(bindingOutPut);
        if (soapBodyDefinition != null) {
            if (responseFromPartnerService.getBody() != null) {
                extractSOAPBodyParts(partnerRoleMessageExchange, messageToODE, responseFromPartnerService.getBody(), soapBodyDefinition.getParts(), soapBodyDefinition.getNamespaceURI(), partnerInvocationContext.isRPCStyleOperation());
            } else {
                throw new BPELFault("SOAP Body cannot be null for WSDL operation which " + "requires SOAP Body.");
            }
        }
    } else {
        javax.wsdl.extensions.soap.SOAPBody soapBodyDefinition = getSOAP11Body(bindingOutPut);
        if (soapBodyDefinition != null) {
            if (responseFromPartnerService.getBody() != null) {
                extractSOAPBodyParts(partnerRoleMessageExchange, messageToODE, responseFromPartnerService.getBody(), soapBodyDefinition.getParts(), soapBodyDefinition.getNamespaceURI(), partnerInvocationContext.isRPCStyleOperation());
            } else {
                throw new BPELFault("SOAP Body cannot be null for WSDL operation which " + "requires SOAP Body.");
            }
        }
    }
    if (getSOAPHeaders(bindingOutPut) != null && responseFromPartnerService.getHeader() != null) {
        extractSoapHeaderParts(messageToODE, partnerInvocationContext.getBpelServiceWSDLDefinition(), responseFromPartnerService.getHeader(), getSOAPHeaders(bindingOutPut), partnerRoleMessageExchange.getOperation().getOutput().getMessage());
    }
    return messageToODE;
}
Also used : BindingOutput(javax.wsdl.BindingOutput) BPELFault(org.wso2.carbon.bpel.core.ode.integration.BPELFault) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope) SOAPFaultCode(org.apache.axiom.soap.SOAPFaultCode) OMNode(org.apache.axiom.om.OMNode) Node(org.w3c.dom.Node) BindingOperation(javax.wsdl.BindingOperation) SOAP12Body(javax.wsdl.extensions.soap12.SOAP12Body)

Example 3 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class SOAPBindingUtil method getBindingOutputSOAPHeaders.

public static List<SoapHeader> getBindingOutputSOAPHeaders(BindingOperation bop) {
    List<SoapHeader> headers = new ArrayList<>();
    BindingOutput bindingOutput = bop.getBindingOutput();
    if (bindingOutput != null) {
        for (Object obj : bindingOutput.getExtensibilityElements()) {
            if (isSOAPHeader(obj)) {
                headers.add(getProxy(SoapHeader.class, obj));
            }
        }
    }
    return headers;
}
Also used : BindingOutput(javax.wsdl.BindingOutput) ArrayList(java.util.ArrayList) SoapHeader(org.apache.cxf.binding.soap.wsdl.extensions.SoapHeader)

Example 4 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class OperationVisitor method generateOutputMessage.

public Message generateOutputMessage(Operation operation, BindingOperation bindingOperation) {
    Message msg = definition.createMessage();
    QName msgName;
    if (!mapper.isDefaultMapping()) {
        // mangle the message name
        // REVISIT, do we put in the entire scope for mangling
        msgName = new QName(definition.getTargetNamespace(), getScope().tail() + "." + operation.getName() + RESPONSE_SUFFIX);
    } else {
        msgName = new QName(definition.getTargetNamespace(), operation.getName() + RESPONSE_SUFFIX);
    }
    msg.setQName(msgName);
    msg.setUndefined(false);
    String outputName = operation.getName() + RESPONSE_SUFFIX;
    Output output = definition.createOutput();
    output.setName(outputName);
    output.setMessage(msg);
    BindingOutput bindingOutput = definition.createBindingOutput();
    bindingOutput.setName(outputName);
    bindingOperation.setBindingOutput(bindingOutput);
    operation.setOutput(output);
    definition.addMessage(msg);
    return msg;
}
Also used : BindingOutput(javax.wsdl.BindingOutput) Message(javax.wsdl.Message) QName(javax.xml.namespace.QName) BindingOutput(javax.wsdl.BindingOutput) Output(javax.wsdl.Output)

Example 5 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class AttributeVisitor method generateCorbaBindingOperation.

private BindingOperation generateCorbaBindingOperation(Binding wsdlBinding, Operation op, OperationType corbaOp) {
    BindingInput bindingInput = definition.createBindingInput();
    bindingInput.setName(op.getInput().getName());
    BindingOutput bindingOutput = definition.createBindingOutput();
    bindingOutput.setName(op.getOutput().getName());
    BindingOperation bindingOperation = definition.createBindingOperation();
    bindingOperation.addExtensibilityElement((ExtensibilityElement) corbaOp);
    bindingOperation.setOperation(op);
    bindingOperation.setName(op.getName());
    bindingOperation.setBindingInput(bindingInput);
    bindingOperation.setBindingOutput(bindingOutput);
    binding.addBindingOperation(bindingOperation);
    return bindingOperation;
}
Also used : BindingOutput(javax.wsdl.BindingOutput) BindingOperation(javax.wsdl.BindingOperation) BindingInput(javax.wsdl.BindingInput)

Aggregations

BindingOutput (javax.wsdl.BindingOutput)15 BindingOperation (javax.wsdl.BindingOperation)9 BindingInput (javax.wsdl.BindingInput)6 ArrayList (java.util.ArrayList)3 Message (javax.wsdl.Message)3 Operation (javax.wsdl.Operation)3 Output (javax.wsdl.Output)3 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)3 SOAPBody (javax.wsdl.extensions.soap.SOAPBody)3 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)3 Input (javax.wsdl.Input)2 WSDLException (javax.wsdl.WSDLException)2 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)2 SOAP12Body (javax.wsdl.extensions.soap12.SOAP12Body)2 QName (javax.xml.namespace.QName)2 OMNode (org.apache.axiom.om.OMNode)2 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)2 Document (org.w3c.dom.Document)2 Element (org.w3c.dom.Element)2 Node (org.w3c.dom.Node)2