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());
}
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;
}
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;
}
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);
}
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);
}
Aggregations