Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPEnvelope.serialize()


        writer.close();
    }

    public void testSerilizationWithDefaultNamespaces() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderTwo.getDocumentElement();
        env.serialize(writer);
        OMElement balanceElement = env.getBody().getFirstElement();
        assertEquals("Deafualt namespace has not been set properly",
                     balanceElement.getNamespace().getNamespaceURI(),
                     "http://localhost:8081/axis/services/BankPort/");
View Full Code Here


        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream,
                OMConstants.DEFAULT_CHAR_SET_ENCODING);

        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
        assertTrue(new String(byteArrayOutputStream.toByteArray()).length() > 1);
    }

    /** Will just do a probe test to check serialize with caching off works without any exception */
 
View Full Code Here

        body.serialize(writer);
    }

    public void testCompleteElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serialize(writer);
    }

    public void testDualNamespaces1() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
View Full Code Here

        ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();

        OMOutputFormat outputFormat = new OMOutputFormat();
        outputFormat.setCharSetEncoding(UTF_16);
        envelope.serialize(byteOutStr, outputFormat);

        ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());

        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(
                StAXUtils.createXMLStreamReader(byteInStr, UTF_16), null);
View Full Code Here

        assertEquals("iso-8859-1", builder.getDocument().getXMLStreamReader().getCharacterEncodingScheme());

        ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
        OMOutputFormat outputFormat = new OMOutputFormat();
        outputFormat.setCharSetEncoding("iso-8859-1");
        envelope.serialize(byteOutStr, outputFormat);

        assertXMLEqual(new InputStreamReader(new ByteArrayInputStream(xml.getBytes("iso-8859-1")),"iso-8859-1"),
                new InputStreamReader(new ByteArrayInputStream(byteOutStr.toByteArray()),"iso-8859-1"));
       
        builder.close();
View Full Code Here

    SOAPHeader sh = se.getHeader();
    Iterator iter = sh.getChildElements();
    while(iter.hasNext())iter.next();

    StringWriter sw = new StringWriter();
    se.serialize(sw);

    checkBodyExists(sw.toString());
   
    se.close(false);
  }
View Full Code Here

    }

    public void testStaxBuilder() throws Exception {
        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
        assertNotNull(envelope);
        envelope.serialize(new FileOutputStream(tempFile));


    }

    protected void tearDown() throws Exception {
View Full Code Here

                        OMAbstractFactory.getSOAP11Factory(), readerTwo);
    }

    public void testSerilizationWithDefaultNamespaces() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderTwo.getDocumentElement();
        env.serialize(writer);
        OMElement balanceElement = env.getBody().getFirstElement();
        assertEquals("Deafualt namespace has not been set properly",
                     balanceElement.getNamespace().getNamespaceURI(),
                     "http://localhost:8081/axis/services/BankPort/");
View Full Code Here

        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        writer = XMLOutputFactory.newInstance().
                createXMLStreamWriter(byteArrayOutputStream);

        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
        assertTrue(new String(byteArrayOutputStream.toByteArray()).length() > 1);
    }

    /** Will just do a probe test to check serialize with caching off works without any exception */
 
View Full Code Here

        body.serialize(writer);
    }

    public void testCompleteElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serialize(writer);
    }

    public void testDualNamespaces1() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.