Search in sources :

Example 1 with SOAP12HeaderBlockImpl

use of org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderBlockImpl in project wso2-synapse by wso2.

the class MessageHelperTest method testCloneSoapEnvelope.

public void testCloneSoapEnvelope() {
    SOAPFactory soapFactory;
    SOAPHeaderBlock header;
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    // Creating a namespace for the header
    OMNamespace ns = omFactory.createOMNamespace("http://ws.apache.org/axis2", "hns");
    OMElement childNode = omFactory.createOMElement("Child", ns);
    // testing SOAP 1.1
    soapFactory = OMAbstractFactory.getSOAP11Factory();
    // creating a SOAP header block
    header = new SOAP11HeaderBlockImpl("CustomHeader", ns, soapFactory);
    performTestForCloneEnvelope(soapFactory, header, childNode);
    // testing SOAP 1.1
    soapFactory = OMAbstractFactory.getSOAP12Factory();
    header = new SOAP12HeaderBlockImpl("CustomHeader", ns, soapFactory);
    performTestForCloneEnvelope(soapFactory, header, childNode);
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) OMNamespace(org.apache.axiom.om.OMNamespace) SOAP12HeaderBlockImpl(org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderBlockImpl) SOAPHeaderBlock(org.apache.axiom.soap.SOAPHeaderBlock) OMElement(org.apache.axiom.om.OMElement) SOAP11HeaderBlockImpl(org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderBlockImpl) SOAPFactory(org.apache.axiom.soap.SOAPFactory)

Aggregations

OMElement (org.apache.axiom.om.OMElement)1 OMFactory (org.apache.axiom.om.OMFactory)1 OMNamespace (org.apache.axiom.om.OMNamespace)1 SOAPFactory (org.apache.axiom.soap.SOAPFactory)1 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)1 SOAP11HeaderBlockImpl (org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderBlockImpl)1 SOAP12HeaderBlockImpl (org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderBlockImpl)1