Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPMessage


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

    protected void runTest() throws Throwable {
        SOAPMessage message = (SOAPMessage)getBuilderForTestMessage(SOAP_MESSAGE).getDocument();
        OMNode firstChild = message.getFirstOMChild();
        assertTrue(firstChild instanceof OMComment);
    }
View Full Code Here


    @Override
    public void setDocument(Document document) {
        // save the Soap Action
        String soapAction = getSoapAction();
        SOAPEnvelope envelope = AxiomUtils.toEnvelope(document);
        SOAPMessage newMessage = axiomFactory.createSOAPMessage();
        newMessage.setSOAPEnvelope(envelope);

        // replace the Axiom message
        setAxiomMessage(newMessage);
        // restore the Soap Action
        setSoapAction(soapAction);
View Full Code Here

        this.preserveModel = preserveModel;
        addTestProperty("preserveModel", String.valueOf(preserveModel));
    }

    protected void runTest() throws Throwable {
        SOAPMessage message = (SOAPMessage)getBuilderForTestMessage(SOAP_MESSAGE).getDocument();
        OMCloneOptions options = new OMCloneOptions();
        options.setPreserveModel(preserveModel);
        OMInformationItem clone = message.clone(options);
        if (preserveModel) {
            assertTrue(clone instanceof SOAPMessage);
        } else {
            assertTrue(clone instanceof OMDocument);
            assertFalse(clone instanceof SOAPMessage);
View Full Code Here

        soapFactory.createOMElement("echo", soapFactory.createOMNamespace("urn:test", null)).setText("test");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OMOutputFormat format = new OMOutputFormat();
        format.setCharSetEncoding(encoding);
        orgEnvelope.serialize(baos, format);
        SOAPMessage message = (SOAPMessage)OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
                new ByteArrayInputStream(baos.toByteArray()), encoding).getDocument();
        assertEquals(encoding, message.getCharsetEncoding());
    }
View Full Code Here

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

    protected void runTest() throws Throwable {
        SOAPMessage message = (SOAPMessage)getBuilderForTestMessage(SOAP_MESSAGE).getDocument();
        assertSame(soapFactory, message.getOMFactory());
    }
View Full Code Here

        this.preserveModel = preserveModel;
        addTestProperty("preserveModel", String.valueOf(preserveModel));
    }

    protected void runTest() throws Throwable {
        SOAPMessage message = soapFactory.createSOAPMessage();
        message.addChild(soapFactory.getDefaultEnvelope());
        OMCloneOptions options = new OMCloneOptions();
        options.setPreserveModel(preserveModel);
        OMInformationItem clone = message.clone(options);
        if (preserveModel) {
            assertTrue(clone instanceof SOAPMessage);
        } else {
            assertTrue(clone instanceof OMDocument);
            assertFalse(clone instanceof SOAPMessage);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(FAILING_FAULT));
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser);
        SOAPMessage soapMessage = builder.getSoapMessage();

        failingMessage = new AxiomSoapMessage(soapMessage, null, false, true);

        parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(SUCCEEDING_FAULT));
        builder = new StAXSOAPModelBuilder(parser);
View Full Code Here

    private AxiomSoapMessage createAxiomSoapMessage(InputStream inputStream, String contentType, String soapAction)
            throws XMLStreamException {
        XMLStreamReader reader = inputFactory.createXMLStreamReader(inputStream, getCharSetEncoding(contentType));
        String envelopeNamespace = getSoapEnvelopeNamespace(contentType);
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(reader, soapFactory, envelopeNamespace);
        SOAPMessage soapMessage = builder.getSoapMessage();
        return new AxiomSoapMessage(soapMessage, soapAction, payloadCaching, langAttributeOnSoap11FaultString);
    }
View Full Code Here

        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLStreamReader reader = inputFactory.createXMLStreamReader(resource.getInputStream());
        StAXSOAPModelBuilder builder =
                new StAXSOAPModelBuilder(reader, OMAbstractFactory.getSOAP11Factory(), SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        SOAPMessage soapMessage = builder.getSoapMessage();

        Document result = AxiomUtils.toDocument(soapMessage.getSOAPEnvelope());

        assertXMLEqual("Invalid document generated from SOAPEnvelope", expected, result);
    }
View Full Code Here

    public final SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
        return new SOAPMessageImpl(builder, this);
    }

    public final SOAPMessage createDefaultSOAPMessage() {
        SOAPMessage message = createSOAPMessage();
        SOAPEnvelope env = createSOAPEnvelope();
        message.addChild(env);
        createSOAPBody(env);
        return message;
    }
View Full Code Here

TOP

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

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.