Search in sources :

Example 86 with SOAPEnvelope

use of org.apache.axiom.soap.SOAPEnvelope 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)

Aggregations

SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)86 OMElement (org.apache.axiom.om.OMElement)28 SOAPBody (org.apache.axiom.soap.SOAPBody)23 OMNamespace (org.apache.axiom.om.OMNamespace)20 SOAPHeader (org.apache.axiom.soap.SOAPHeader)20 SOAPFault (org.apache.axiom.soap.SOAPFault)14 QName (javax.xml.namespace.QName)12 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)12 OMNode (org.apache.axiom.om.OMNode)11 SOAPModelBuilder (org.apache.axiom.soap.SOAPModelBuilder)11 SOAPFactory (org.apache.axiom.soap.SOAPFactory)10 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)8 StringReader (java.io.StringReader)7 OMSourcedElement (org.apache.axiom.om.OMSourcedElement)7 ByteArrayInputStream (java.io.ByteArrayInputStream)6 DataHandler (javax.activation.DataHandler)6 OMOutputFormat (org.apache.axiom.om.OMOutputFormat)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 MultipartBody (org.apache.axiom.mime.MultipartBody)5 SOAPFaultDetail (org.apache.axiom.soap.SOAPFaultDetail)5