Search in sources :

Example 81 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.

the class TestGetHeaderBlocksWithNSURI method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPEnvelope soapEnvelope = soapFactory.createSOAPEnvelope();
    SOAPHeader soapHeader = soapFactory.createSOAPHeader(soapEnvelope);
    OMNamespace namespace = soapFactory.createOMNamespace("http://www.example.org", "test");
    soapHeader.addHeaderBlock("echoOk1", namespace);
    soapHeader.addHeaderBlock("echoOk2", soapFactory.createOMNamespace("http://www.test1.org", "test1"));
    ArrayList<SOAPHeaderBlock> arrayList = soapHeader.getHeaderBlocksWithNSURI("http://www.test1.org");
    assertEquals("SOAP Header Test : - getHeaderBlocksWithNSURI returns an arrayList of incorrect size", 1, arrayList.size());
    assertEquals("SOAP Header Test : - headerBlock of given namespace uri mismatch", "http://www.test1.org", arrayList.get(0).getNamespace().getNamespaceURI());
}
Also used : OMNamespace(org.apache.axiom.om.OMNamespace) SOAPHeaderBlock(org.apache.axiom.soap.SOAPHeaderBlock) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope) SOAPHeader(org.apache.axiom.soap.SOAPHeader)

Example 82 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.

the class SOAP11Factory method getDefaultFaultEnvelope.

@Override
public final SOAPEnvelope getDefaultFaultEnvelope() {
    SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
    SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());
    createSOAPFaultCode(fault);
    createSOAPFaultReason(fault);
    createSOAPFaultDetail(fault);
    return defaultEnvelope;
}
Also used : SOAPFault(org.apache.axiom.soap.SOAPFault) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope)

Example 83 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.

the class SOAPFactoryImpl method getDefaultEnvelope.

@Override
public final SOAPEnvelope getDefaultEnvelope() {
    SOAPEnvelope env = createSOAPEnvelope();
    createSOAPHeader(env);
    createSOAPBody(env);
    return env;
}
Also used : SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope)

Example 84 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.

the class CopyUtils method copy.

/**
     * @deprecated This method has the same effect as calling
     *             {@link OMInformationItem#clone(OMCloneOptions)} on the source
     *             {@link SOAPEnvelope} with the following options enabled:
     *             <ul>
     *             <li>{@link OMCloneOptions#setFetchDataHandlers(boolean)}
     *             <li>{@link OMCloneOptions#setPreserveModel(boolean)}
     *             <li>{@link OMCloneOptions#setCopyOMDataSources(boolean)}
     *             </ul>
     *             Instead of using this method, application code should use
     *             {@link OMInformationItem#clone(OMCloneOptions)} directly and fine tune the
     *             options for the particular use case.
     */
public static SOAPEnvelope copy(SOAPEnvelope sourceEnv) {
    SOAPCloneOptions options = new SOAPCloneOptions();
    options.setFetchDataHandlers(true);
    options.setPreserveModel(true);
    options.setCopyOMDataSources(true);
    return (SOAPEnvelope) sourceEnv.clone(options);
}
Also used : SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope) SOAPCloneOptions(org.apache.axiom.soap.SOAPCloneOptions)

Example 85 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope in project webservices-axiom by apache.

the class ElementSerializerTest method testElement.

public void testElement() throws Exception {
    SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
    SOAPBody body = env.getBody();
    body.serialize(writer);
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope)

Aggregations

SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)105 OMElement (org.apache.axiom.om.OMElement)32 SOAPBody (org.apache.axiom.soap.SOAPBody)24 OMNamespace (org.apache.axiom.om.OMNamespace)22 SOAPHeader (org.apache.axiom.soap.SOAPHeader)20 SOAPFactory (org.apache.axiom.soap.SOAPFactory)18 QName (javax.xml.namespace.QName)16 SOAPFault (org.apache.axiom.soap.SOAPFault)14 ByteArrayInputStream (java.io.ByteArrayInputStream)12 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)12 OMNode (org.apache.axiom.om.OMNode)11 SOAPModelBuilder (org.apache.axiom.soap.SOAPModelBuilder)11 MessageContext (org.apache.axis2.context.MessageContext)10 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)8 InputStream (java.io.InputStream)7 XMLStreamException (javax.xml.stream.XMLStreamException)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 StringReader (java.io.StringReader)6 DataHandler (javax.activation.DataHandler)6 OMException (org.apache.axiom.om.OMException)6