Package org.apache.axis2.om.impl.llom.builder

Examples of org.apache.axis2.om.impl.llom.builder.StAXOMBuilder


                            //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                            //the SOAP Action is absent it is rest !!
                            msgContext.setDoingREST(true);

                            SOAPFactory soapFactory = new SOAP11Factory();
                            builder = new StAXOMBuilder(xmlreader);
                            builder.setOmbuilderFactory(soapFactory);
                            envelope = soapFactory.getDefaultEnvelope();
                            envelope.getBody().addChild(
                                builder.getDocumentElement());
                        } else {
View Full Code Here


        body.addChild(elt);
    }


    protected OMElement getElementFromReader(XMLStreamReader reader) {
        StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(
                OMAbstractFactory.getOMFactory(), reader);
        return builder.getDocumentElement();
    }
View Full Code Here

        XMLStreamReader xmlReader =
            XMLInputFactory.newInstance().createXMLStreamReader(
                new ByteArrayInputStream(str.getBytes()));
        OMFactory fac = OMAbstractFactory.getOMFactory();

        StAXOMBuilder staxOMBuilder =
            new StAXOMBuilder(fac, xmlReader);
        return staxOMBuilder.getDocumentElement();
    }
View Full Code Here

        XMLStreamReader xmlReader =
            XMLInputFactory.newInstance().createXMLStreamReader(
                new ByteArrayInputStream(str.getBytes()));
        OMFactory fac = OMAbstractFactory.getOMFactory();

        StAXOMBuilder staxOMBuilder =
            new StAXOMBuilder(fac, xmlReader);
        return staxOMBuilder.getDocumentElement();
    }
View Full Code Here

                                //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                                //the SOAP Action is absent it is rest !!
                                msgContext.setDoingREST(true);

                                SOAPFactory soapFactory = new SOAP11Factory();
                                builder = new StAXOMBuilder(xmlreader);
                                builder.setOmbuilderFactory(soapFactory);
                                envelope = soapFactory.getDefaultEnvelope();
                                envelope.getBody().addChild(
                                        builder.getDocumentElement());
                            }
View Full Code Here

        assertEquals(((Boolean) resBean[0]).booleanValue(), true);
        call.close();
    }

    private OMElement getOMelemnt(String str, OMFactory fac) throws AxisFault {
        StAXOMBuilder staxOMBuilder;
        try {
            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
                    ByteArrayInputStream(str.getBytes()));
            staxOMBuilder = new
                    StAXOMBuilder(fac, xmlReader);
        } catch (XMLStreamException e) {
            throw new AxisFault(e);
        } catch (FactoryConfigurationError factoryConfigurationError) {
            throw new AxisFault(factoryConfigurationError);
        }
        return staxOMBuilder.getDocumentElement();
    }
View Full Code Here

                "    <item0>abc</item0>\n" +
                "    <item0>def</item0>\n" +
                "    <item0>ghi</item0>\n" +
                "    <item0>klm</item0>\n" +
                "</reference>";
        StAXOMBuilder staxOMBuilder;
        try {
            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new
                    ByteArrayInputStream(str.getBytes()));
            staxOMBuilder = new
                    StAXOMBuilder(fac, xmlReader);
        } catch (XMLStreamException e) {
            throw new AxisFault(e);
        } catch (FactoryConfigurationError factoryConfigurationError) {
            throw new AxisFault(factoryConfigurationError);
        }
        envelope.getBody().addChild(staxOMBuilder.getDocumentElement());
        RPCCall call =
                new RPCCall("target/test-resources/intregrationRepo");

        Options options = new Options();
        call.setClientOptions(options);
View Full Code Here

        return returnString;
    }

    public int getChildrenCount(String xml) throws XMLStreamException {
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
        OMElement documentElement = new StAXOMBuilder(bais).getDocumentElement();
        int omElementCount = 0;
        int omTextCount = 0;
        Iterator childrenIter = documentElement.getChildren();
        while (childrenIter.hasNext()) {
            Object o = childrenIter.next();
View Full Code Here

  public Document parse(InputSource inputSource) throws SAXException, IOException {
    try {
      OMDOMFactory factory = new OMDOMFactory();
      //Not really sure whether this will work :-?
      XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(inputSource.getCharacterStream());
      StAXOMBuilder builder = new StAXOMBuilder(factory,reader);
      DocumentImpl doc = (DocumentImpl)builder.getDocument();
      ((ElementImpl)doc.getDocumentElement()).build();
      return (DocumentImpl)builder.getDocument();
    }catch (XMLStreamException e) {
      throw new SAXException(e);
    }
  }
View Full Code Here

   */
  public Document parse(InputStream is) throws SAXException, IOException {
    try {
      OMDOMFactory factory = new OMDOMFactory();
      XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);
      StAXOMBuilder builder = new StAXOMBuilder(factory,reader);
      return (DocumentImpl)builder.getDocument();
    }catch (XMLStreamException e) {
      throw new SAXException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.impl.llom.builder.StAXOMBuilder

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.