Search in sources :

Example 1 with OdeFault

use of org.apache.ode.axis2.OdeFault in project carbon-business-process by wso2.

the class SOAPHelper method createSoapRequest.

public void createSoapRequest(MessageContext msgCtx, Element message, Operation op) throws AxisFault {
    if (op == null) {
        throw new NullPointerException("Null operation");
    }
    // The message can be null if the input message has no part
    if (op.getInput().getMessage().getParts().size() > 0 && message == null) {
        throw new NullPointerException("Null message.");
    }
    if (msgCtx == null) {
        throw new NullPointerException("Null msgCtx");
    }
    BindingOperation bop = binding.getBindingOperation(op.getName(), null, null);
    if (bop == null) {
        throw new OdeFault("BindingOperation not found.");
    }
    BindingInput bi = bop.getBindingInput();
    if (bi == null) {
        throw new OdeFault("BindingInput not found.");
    }
    SOAPEnvelope soapEnv = msgCtx.getEnvelope();
    if (soapEnv == null) {
        soapEnv = soapFactory.getDefaultEnvelope();
        msgCtx.setEnvelope(soapEnv);
    }
    // createSoapHeaders(soapEnv, getSOAPHeaders(bi), op.getInput().getMessage(), message);
    SOAPBody soapBody = getSOAPBody(bi);
    if (soapBody != null) {
        org.apache.axiom.soap.SOAPBody sb = soapEnv.getBody() == null ? soapFactory.createSOAPBody(soapEnv) : soapEnv.getBody();
        createSoapBody(sb, soapBody, op.getInput().getMessage(), message, op.getName());
    }
}
Also used : BindingOperation(javax.wsdl.BindingOperation) SOAPBody(javax.wsdl.extensions.soap.SOAPBody) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope) BindingInput(javax.wsdl.BindingInput) OdeFault(org.apache.ode.axis2.OdeFault)

Aggregations

BindingInput (javax.wsdl.BindingInput)1 BindingOperation (javax.wsdl.BindingOperation)1 SOAPBody (javax.wsdl.extensions.soap.SOAPBody)1 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)1 OdeFault (org.apache.ode.axis2.OdeFault)1