Search in sources :

Example 31 with SOAPBody

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

the class TestGetFaultNoFault method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
    body.addChild(soapFactory.createOMElement(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix()));
    assertNull(body.getFault());
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody)

Example 32 with SOAPBody

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

the class TestGetFaultFakeFault method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
    soapFactory.createOMElement("Fault", soapFactory.getNamespace(), body);
    assertNull(body.getFault());
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody)

Example 33 with SOAPBody

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

the class TestGetFirstElementLocalNameWithParser2 method runTest.

@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
    SOAPBody body = envelope.getBody();
    if (buildPayload) {
        body.getFirstElement().build();
    }
    assertThat(body.getFirstElementLocalName()).isEqualTo("test");
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody)

Example 34 with SOAPBody

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

the class TestGetFirstElementLocalNameWithParserNoLookahead method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPEnvelope orgEnvelope = soapFactory.getDefaultEnvelope();
    OMElement payload = soapFactory.createOMElement("payload", soapFactory.createOMNamespace("urn:test", "p"), orgEnvelope.getBody());
    OMElement child = soapFactory.createOMElement("child", null, payload);
    soapFactory.createOMElement("grandchild", null, child);
    SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory, new StringReader(orgEnvelope.toString()));
    SOAPBody body = builder.getSOAPEnvelope().getBody();
    body.getFirstElement().getFirstElement();
    assertThat(body.getFirstElementLocalName()).isEqualTo("payload");
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody) StringReader(java.io.StringReader) OMElement(org.apache.axiom.om.OMElement) SOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope) SOAPModelBuilder(org.apache.axiom.soap.SOAPModelBuilder)

Example 35 with SOAPBody

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

the class TestHasFaultFakeFault method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
    soapFactory.createOMElement("Fault", soapFactory.getNamespace(), body);
    assertFalse(body.hasFault());
}
Also used : SOAPBody(org.apache.axiom.soap.SOAPBody)

Aggregations

SOAPBody (org.apache.axiom.soap.SOAPBody)37 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)24 OMElement (org.apache.axiom.om.OMElement)13 SOAPFault (org.apache.axiom.soap.SOAPFault)7 SOAPFaultDetail (org.apache.axiom.soap.SOAPFaultDetail)7 OMNamespace (org.apache.axiom.om.OMNamespace)6 QName (javax.xml.namespace.QName)5 SOAPHeader (org.apache.axiom.soap.SOAPHeader)5 StringReader (java.io.StringReader)4 OMNode (org.apache.axiom.om.OMNode)4 SOAPFactory (org.apache.axiom.soap.SOAPFactory)4 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)4 OMDataSource (org.apache.axiom.om.OMDataSource)3 OMSourcedElement (org.apache.axiom.om.OMSourcedElement)3 StringOMDataSource (org.apache.axiom.om.ds.StringOMDataSource)3 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)3 SOAPFaultReason (org.apache.axiom.soap.SOAPFaultReason)3 SOAPFaultRole (org.apache.axiom.soap.SOAPFaultRole)3 StringWriter (java.io.StringWriter)2 Iterator (java.util.Iterator)2