Package org.apache.axiom.soap.impl.builder

Examples of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder


                                "http://moretesting.ws.org", "ws"), firstElement);
    }

    public void testGetText() {
        try {
            StAXSOAPModelBuilder soapBuilder = getOMBuilder(
                    "soap/OMElementTest.xml");
            SOAPEnvelope soapEnvelope = (SOAPEnvelope) soapBuilder.getDocumentElement();
            OMElement wsaTo = soapEnvelope.getHeader().getFirstChildWithName(
                    new QName(WSA_URI, WSA_TO));

            String expectedString = "http://localhost:8081/axis/services/BankPort";
            assertEquals("getText is not returning the correct value",
View Full Code Here


        outputFormat.setCharSetEncoding(UTF_16);
    envelope.serialize(byteOutStr, outputFormat);
   
    ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
   
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16),null);

    SOAPEnvelope resultEnv = builder.getSOAPEnvelope();
   
    OMElement bodyChildResult = resultEnv.getBody().getFirstElement();
   
    assertNotNull("No child in body element", bodyChildResult);
   
View Full Code Here

     * @param parser
     * @return Returns StAXSOAPModelBuilder.
     */
    public static StAXSOAPModelBuilder createStAXSOAPModelBuilder(
            SOAPFactory soapFactory, XMLStreamReader parser) {
        return new StAXSOAPModelBuilder(parser, soapFactory, null);
    }
View Full Code Here

                "http://moretesting.ws.org", "ws"), firstElement);
    }

    public void testGetText() {
        try {
            StAXSOAPModelBuilder soapBuilder = getOMBuilder(
                    "soap/OMElementTest.xml");
            SOAPEnvelope soapEnvelope = (SOAPEnvelope) soapBuilder.getDocumentElement();
            OMElement wsaTo = soapEnvelope.getHeader().getFirstChildWithName(
                    new QName(WSA_URI, WSA_TO));

            String expectedString = "http://localhost:8081/axis/services/BankPort";
            assertEquals("getText is not returning the correct value",
View Full Code Here

    "<soapenv:Body><x:Content xmlns:x=\"http://test/\">Hello</x:Content></soapenv:Body>"+
      "</soapenv:Envelope>";

  public void testBodyPreservedSerialize() throws Exception{
    XMLStreamReader parser = StAXUtils.createXMLStreamReader(new StringReader(testMessage));
    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();
    SOAPHeader sh = se.getHeader();
    Iterator iter = sh.getChildElements();
    while(iter.hasNext())iter.next();

    StringWriter sw = new StringWriter();
View Full Code Here

    checkBodyExists(sw.toString());
  }

  public void testBodyPreservedSerializeAndConsume() throws Exception{
    XMLStreamReader parser = StAXUtils.createXMLStreamReader(new StringReader(testMessage));
    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();
    SOAPHeader sh = se.getHeader();
        sh.build();
    StringWriter sw = new StringWriter();
    se.serializeAndConsume(sw);
View Full Code Here

    checkBodyExists(sw.toString());
  }

    public void testBodyPreservedSerializeAndConsumeDoesntTouchHeaders() throws Exception{
    XMLStreamReader parser = StAXUtils.createXMLStreamReader(new StringReader(testMessage));
    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();

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

    checkBodyExists(sw.toString());
View Full Code Here

    checkBodyExists(sw.toString());
  }

  public void testBodyPreservedSerializeAndConsumeTouchesBody() throws Exception{
    XMLStreamReader parser = StAXUtils.createXMLStreamReader(new StringReader(testMessage));
    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();
    SOAPHeader sh = se.getHeader();
    Iterator iter = sh.getChildElements();
    while(iter.hasNext())iter.next();
    se.getBody();
    StringWriter sw = new StringWriter();
View Full Code Here

    checkBodyExists(sw.toString());
  }

  private void checkBodyExists(String str) throws Exception{
    XMLStreamReader parser = StAXUtils.createXMLStreamReader(new StringReader(str));
    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();
    SOAPBody sb = se.getBody();
    if(sb == null){
      fail("No SOAP Body");
    }
    Iterator children = sb.getChildElements();
View Full Code Here

    public void testSOAPFactory() {

        try {
            SOAPEnvelope soapEnvelope =
                    (SOAPEnvelope) new StAXSOAPModelBuilder(XMLInputFactory.newInstance().
                            createXMLStreamReader(new FileInputStream(SOAP11_FILE_NAME)), null)
                            .getDocumentElement();
            assertTrue(soapEnvelope != null);

            soapEnvelope = (SOAPEnvelope) new StAXSOAPModelBuilder(XMLInputFactory.newInstance().
                    createXMLStreamReader(new FileInputStream(SOAP12_FILE_NAME)), null)
                    .getDocumentElement();
            assertTrue(soapEnvelope != null);
        } catch (XMLStreamException e) {
            fail("Can not load soap envelope. Exception = " + e);
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder

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.