Package org.dom4j.io

Examples of org.dom4j.io.XPP3Reader


            }
        }
    }

    private void parse(File tmp) {
        XPP3Reader xreader = new XPP3Reader();
        try {
            index = xreader.read(tmp);
        } catch (Exception e) {
            log.error(e.toString(), true);
        }
    }
View Full Code Here


        detailElement.setText("P5M");
        fault.setDetail(detailElement);
        Element faultElement = fault.toXmlElement();
        faultElement.addNamespace(SoapConstants.XML_PREFIX, SoapConstants.XML_NS);

        XPP3Reader reader = new XPP3Reader();
        Document expected = reader.read(getClass().getResourceAsStream("simple-fault.xml"));

        // Can't understand why we need 5 here, as the elements are really the same!
        assertEquals(5, nodeComparator.compare(expected.getRootElement(), faultElement));
    }
View Full Code Here

        SoapMessageUtils.registerDocumentFactoryXPathNamespaceURIs(factory, "xsd", XSD_NS_URI);
        SoapMessageUtils.registerDocumentFactoryXPathNamespaceURIs(factory, "wsdl", WSDL_NS_URI);
        SoapMessageUtils.registerDocumentFactoryXPathNamespaceURIs(factory, "wsoap12", WSOAP12_NS_URI);
        SoapMessageUtils.registerDocumentFactoryXPathNamespaceURIs(factory, "wsdl-dtc", WSDL_DTC_NS_URI);

        XPP3Reader reader = new XPP3Reader();
        Document doc;
        try
        {
            doc = reader.read(getClass().getResourceAsStream(resource));
        }
        catch (Exception e)
        {
            e.printStackTrace();
            wsdl = "Could not generate a WSDL document...";
View Full Code Here

    public void testProvider() throws Exception
    {
        WsdlDtcProvider provider = new WsdlDtcProvider("/com/izforge/soapdtc/servlet/wsdl-dtc.xml", "http://localhost:8080/test/endpoint");
        provider.generateWsdl();

        XPP3Reader reader = new XPP3Reader();

        Document result = provider.getWsdlDOM();
        Document expected = reader.read(getClass().getResourceAsStream("wsdl-dtc-wsdl.xml"));

        //System.out.println(result.asXML());
        NodeComparator comparator = new NodeComparator();
        assertEquals(6, comparator.compare(expected, result));
    }
View Full Code Here

     * @throws XmlPullParserException if the parser encounters a problem.
     */
    public static SoapMessage readSoapMessageFromStream(InputStream in, DocumentFactory documentFactory) throws DocumentException, IOException, XmlPullParserException
    {
        configureDocumentFactoryXPathNamespaceURIs(documentFactory);
        XPP3Reader reader = new XPP3Reader(documentFactory);
        Document envelope = reader.read(in);
        in.close();
        return new SoapMessage(documentFactory, envelope);
    }
View Full Code Here

TOP

Related Classes of org.dom4j.io.XPP3Reader

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.