Examples of OMXMLParserWrapper


Examples of org.apache.axiom.om.OMXMLParserWrapper

                "Programatically created SOAPEnvelope should have done = true ",
                soapEnvelopeTwo.isComplete());
    }

    public void testCreateSOAPHeader() throws Exception {
        OMXMLParserWrapper omBuilder = OMXMLBuilderFactory.createSOAPModelBuilder(
                getTestResource(TestConstants.MINIMAL_MESSAGE), null);
        SOAPEnvelope soapEnvelope = (SOAPEnvelope) omBuilder.getDocumentElement();
        SOAPHeader soapHeader = omFactory.createSOAPHeader(soapEnvelope);
        assertTrue(
                "Programatically created SOAPHeader should have done = true ",
                soapHeader.isComplete());
    }
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

                "Programatically created SOAPHeader should have done = true ",
                soapHeader.isComplete());
    }

    public void testCreateSOAPHeaderBlock() throws Exception {
        OMXMLParserWrapper omBuilder = OMXMLBuilderFactory.createSOAPModelBuilder(
                getTestResource(TestConstants.SOAP_SOAPMESSAGE), null);
        SOAPEnvelope soapEnvelope = (SOAPEnvelope) omBuilder.getDocumentElement();
        SOAPHeader soapHeader = soapEnvelope.getHeader();
        SOAPHeaderBlock soapHeaderBlock = omFactory.createSOAPHeaderBlock(
                "soapHeaderBlockOne", namespace, soapHeader);
        assertTrue(
                "Programatically created SOAPHeaderBlock should have done = true ",
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

    public void setErrorHandler(ErrorHandler eh) {
        // TODO
    }

    public Document parse(InputSource inputSource) throws SAXException, IOException {
        OMXMLParserWrapper builder = factory.getMetaFactory().createOMBuilder(factory,
                StAXParserConfiguration.DEFAULT, inputSource);
        DocumentImpl doc = (DocumentImpl) builder.getDocument();
        doc.close(true);
        return doc;
    }
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

            this.build();
        }
    }

    public void close(boolean build) {
        OMXMLParserWrapper builder = getBuilder();
        if (build) {
            this.build();
        }
        setComplete(true);
       
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

    protected void runTest() throws Throwable {
        StringWriter writer = new StringWriter();
        XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);

        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(
                metaFactory.getOMFactory(), root.getXMLStreamReader());
        OMDocument omDocument = builder.getDocument();
        Iterator it = omDocument.getChildren();
        while (it.hasNext()) {
            OMNode omNode = (OMNode) it.next();
            // TODO: quick fix required because OMChildrenIterator#next() no longer builds the node
            omNode.getNextOMSibling();
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

        OMFactory factory = metaFactory.getOMFactory();
        OMDataSource ds = new ByteArrayDataSource("<root><a/></root>".getBytes("utf-8"), "utf-8");
        OMSourcedElement element = factory.createOMElement(ds);
        // Force expansion
        element.getFirstOMChild();
        OMXMLParserWrapper builder = element.getBuilder();
        try {
            builder.getDocument();
            fail("Expected UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
            // Expected
        }
        try {
            builder.getDocumentElement();
            fail("Expected UnsupportedOperationException");
        } catch (UnsupportedOperationException ex) {
            // Expected
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

     * See http://issues.apache.org/jira/browse/WSCOMMONS-240
     * @param om
     */
    public static void completeAndClose(OMElement om) {
        // Get the builder associated with the om element
        OMXMLParserWrapper builder = om.getBuilder();
        if (builder != null) {
            if (builder instanceof StAXBuilder) {
                ((StAXBuilder)builder).releaseParserOnClose(true);
            }
            OMElement document = builder.getDocumentElement();
            if (document != null) {
                document.build();
            }
        }
        if (builder instanceof StAXBuilder) {
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

     * This method will close the builder immediately.  Any subsequent Axiom objects won't
     * be built or accessible.
     */
    public static void closeImmediately(OMElement om) {
        // Get the builder associated with the om element
        OMXMLParserWrapper builder = om.getBuilder();
        if (builder != null) {
            if (builder instanceof StAXBuilder) {
                ((StAXBuilder)builder).releaseParserOnClose(true);
                ((StAXBuilder)builder).close();
            }
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

     * See http://issues.apache.org/jira/browse/WSCOMMONS-240
     * @param om
     */
    public static void completeAndClose(OMElement om) {
        // Get the builder associated with the om element
        OMXMLParserWrapper builder = om.getBuilder();
        if (builder != null) {
            if (builder instanceof StAXBuilder) {
                ((StAXBuilder)builder).releaseParserOnClose(true);
            }
            OMElement document = builder.getDocumentElement();
            if (document != null) {
                document.build();
            }
        }
        if (builder instanceof StAXBuilder) {
View Full Code Here

Examples of org.apache.axiom.om.OMXMLParserWrapper

     * This method will close the builder immediately.  Any subsequent Axiom objects won't
     * be built or accessible.
     */
    public static void closeImmediately(OMElement om) {
        // Get the builder associated with the om element
        OMXMLParserWrapper builder = om.getBuilder();
        if (builder != null) {
            if (builder instanceof StAXBuilder) {
                ((StAXBuilder)builder).releaseParserOnClose(true);
                ((StAXBuilder)builder).close();
            }
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.