Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPBody


    }

    protected void runTest() throws Throwable {
        SOAPEnvelope soapEnvelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
                AbstractTestCase.getTestResource(TestConstants.SOAP_SOAPMESSAGE), null).getSOAPEnvelope();
        SOAPBody body = soapEnvelope.getBody();

        OMElement firstClonedBodyElement = body.cloneOMElement();
        OMElement secondClonedBodyElement = body.cloneOMElement();

        // first check whether both have the same information
        XMLAssert.assertXMLEqual(body.toString(),
                                 firstClonedBodyElement.toString());
        XMLAssert.assertXMLEqual(body.toString(),
                                 secondClonedBodyElement.toString());
        XMLAssert.assertXMLEqual(firstClonedBodyElement.toString(),
                                 secondClonedBodyElement.toString());

        // The clone is expected to be orphaned
View Full Code Here


        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        SOAPBody body = envelope.getBody();
        OMSourcedElement element = soapFactory.createOMElement(new ByteArrayDataSource(
                "<ns:root xmlns:ns='urn:ns'/>".getBytes("utf-8"), "utf-8"));
        body.addChild(element);
        assertFalse(body.hasFault());
        assertFalse(element.isExpanded());
    }
View Full Code Here

        super(omMetaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        SOAPFault fault = soapFactory.createSOAPFault(body);
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail(fault);
        OMNamespace omNamespace = soapFactory.createOMNamespace("http://www.test.org", "test");
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry1", omNamespace));
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        body.addFault(soapFactory.createSOAPFault());
        assertTrue(
                "Body Test:- After calling addFault method, SOAP body has no fault",
                body.hasFault());
    }
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        assertFalse(
                "Body Test:- After creating a soap body it has a fault",
                body.hasFault());
        body.addFault(new Exception("This an exception for testing"));
        assertTrue(
                "Body Test:- After calling addFault method, hasFault method returns false",
                body.hasFault());
    }
View Full Code Here

    public TestGetFaultFakeFault(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPBody body = soapFactory.getDefaultEnvelope().getBody();
        soapFactory.createOMElement("Fault", soapFactory.getNamespace(), body);
        assertNull(body.getFault());
    }
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        SOAPFault fault = soapFactory.createSOAPFault(body);
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail(fault);
        OMNamespace omNamespace = soapFactory.createOMNamespace("http://www.test.org", "test");
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry1", omNamespace));
View Full Code Here

    public TestHasFaultAfterReplace(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPBody body = soapFactory.getDefaultFaultEnvelope().getBody();
        assertTrue(body.hasFault());
        body.getFault().detach();
        soapFactory.createOMElement("echo", soapFactory.createOMNamespace("urn:test", "echo"));
        assertFalse(body.hasFault());
    }
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        assertNull(
                "Body Test:- After creating a soap body it has a fault",
                body.getFault());
        body.addFault(new Exception("This an exception for testing"));
        assertNotNull(
                "Body Test:- After calling addFault method, getFault method returns null",
                body.getFault());
    }
View Full Code Here

        StringBuilder builder = new StringBuilder("AxiomSoapMessage");
        if (payloadCaching) {
            try {
                SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope();
                if (envelope != null) {
                    SOAPBody body = envelope.getBody();
                    if (body != null) {
                        OMElement bodyElement = body.getFirstElement();
                        if (bodyElement != null) {
                            builder.append(' ');
                            builder.append(bodyElement.getQName());
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPBody

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.