Package org.apache.ws.commons.soap

Examples of org.apache.ws.commons.soap.SOAPEnvelope


    }

    public void submitPurchaseOrderTest()
            throws Exception {
        SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope env = omFactory.getDefaultEnvelope();
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(
                omFactory,
                XMLInputFactory.newInstance().
                createXMLStreamReader(
                        new InputStreamReader(
                                new ByteArrayInputStream(xmlText2.getBytes()))));
        env.getBody().addChild(builder.getDocumentElement());

        env.serialize(System.out);
    }
View Full Code Here


        env.serialize(System.out);
    }

    public void testSerilizationWithCacheOn() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
    }
View Full Code Here

        env.serialize(writer);
        writer.flush();
    }

    public void testSerilizationWithCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
    }
View Full Code Here

    public void testElementPullStream1() throws Exception {
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        StreamingOMSerializer serializer = new StreamingOMSerializer();
        serializer.serialize(env.getXMLStreamReaderWithoutCaching(), writer);
        writer.flush();
    }
View Full Code Here

    public void testElementPullStream1WithCacheOff() throws Exception {
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);

        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serializeAndConsume(writer);
        writer.flush();

        //now we should not be able to serilaize anything ! this should throw
        //an error
        try {
           env.serializeAndConsume(writer);
           fail();
        } catch (XMLStreamException e) {
           assertTrue(true);
        } catch (Exception e) {
           assertTrue(true);
View Full Code Here

    public void testElementPullStream2() throws Exception {
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
        StreamingOMSerializer serializer = new StreamingOMSerializer();
        serializer.serialize(body.getXMLStreamReaderWithoutCaching(),
                writer);
        writer.flush();
    }
View Full Code Here

public class OMElementCloneTest extends XMLTestCase {

    File dir = new File(TestConstants.TEST_RESOURCES, TestConstants.SOAP_DIR);

    public void testElementCloningWithoutUsingOMElementMethod() throws Exception {
        SOAPEnvelope soapEnvelope =
                (SOAPEnvelope) OMTestUtils.getOMBuilder(
                        new File(dir, TestConstants.SOAPMESSAGE))
                        .getDocumentElement();
        SOAPBody body = soapEnvelope.getBody();

        OMElement firstClonedBodyElement = new StAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();
        OMElement secondClonedBodyElement = new StAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();

        // first check whether both have the same information
View Full Code Here

        assertNotSame(firstClonedBodyElement.getParent(), secondClonedBodyElement.getParent());

    }

    public void testElementCloningUsingOMElementMethod() throws Exception {
        SOAPEnvelope soapEnvelope =
                (SOAPEnvelope) OMTestUtils.getOMBuilder(
                        new File(dir, TestConstants.SOAPMESSAGE))
                        .getDocumentElement();
        SOAPBody body = soapEnvelope.getBody();

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

        // first check whether both have the same information
View Full Code Here

        node.serialize(writer);

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }
View Full Code Here

        OMNode node = env.getBody();
        node.serialize(writer);
    }

    public void testElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
        body.serialize(writer);
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.soap.SOAPEnvelope

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.