Package org.jdom

Examples of org.jdom.Document


    }

    public void testWSDLDocument()
        throws Exception
    {
        Document wsdl = getWSDLDocument("ws1");
        assertValid("//wsdl:types/xsd:schema/xsd:complexType[@name='ArrayOfBeanD']", wsdl);
    }
View Full Code Here


    Service endpoint = getServiceFactory().create(RenamedBeanService.class);
    getServiceRegistry().register(endpoint);
  }

  public void testWSDL() throws Exception {
    Document doc = getWSDLDocument("RenamedBeanService");

    printNode(doc);

    addNamespace("xsd", SoapConstants.XSD);
    assertValid("//xsd:complexType[@name='NewBean']", doc);
View Full Code Here

        Element root = new Element("root");
        Element schema = new Element("schema");
        root.addContent(schema);

        Document doc = new Document(root);

        bt.writeSchema(schema);

        // TODO: run XPath tests on Schema
    }
View Full Code Here

       
        reader.getXMLStreamReader().close();
       
        // Test writing
        Element element = new Element("map", "urn:test");
        Document doc = new Document(element);
        JDOMWriter writer = new JDOMWriter(element);
        type.writeObject(m, writer, new MessageContext());
        writer.close();

        assertValid("/t:map/t:entry[1]/t:key[text()='key1']", element);
        assertValid("/t:map/t:entry[1]/t:value[text()='value1']", element);

        assertValid("/t:map/t:entry[2]/t:key[text()='key2']", element);
        assertValid("/t:map/t:entry[2]/t:value[text()='value2']", element);

        Element types = new Element("types", Namespace.getNamespace("xsd", SoapConstants.XSD));
        Element schema = new Element("schema", Namespace.getNamespace("xsd", SoapConstants.XSD));
        types.addContent(schema);
       
        doc = new Document(types);
       
        type.writeSchema(schema);

        assertValid("//xsd:complexType[@name='map']", doc);
        assertValid("//xsd:complexType[@name='map']/xsd:sequence/xsd:element[@name='entry']", doc);
View Full Code Here

    }

    public void testInvoke()
        throws Exception
    {
        Document response = invokeService("Echo", "/org/codehaus/xfire/plexus/config/echo11.xml");

        addNamespace("e", "urn:Echo");
        assertValid("//e:out[text()='Yo Yo']", response);

        response = invokeService("EchoIntf", "/org/codehaus/xfire/plexus/config/echo11.xml");
View Full Code Here

        throws Exception
    {
        MessagePartInfo info = (MessagePartInfo) endpoint.getServiceInfo()
                .getOperation("GetWeatherByZipCode").getInputMessage().getMessageParts().get(0);

        Document response = invokeService("WeatherService", "GetWeatherByZip.xml");

        addNamespace("w", "http://www.webservicex.net");
        assertValid("//s:Body/w:GetWeatherByZipCodeResponse/w:GetWeatherByZipCodeResult", response);
    }
View Full Code Here

    }

    public void testWsdl()
        throws Exception
    {
        Document doc = getWSDLDocument("WeatherService");

        addNamespace("xsd", SoapConstants.XSD);

        assertValid("//xsd:schema[@targetNamespace='http://www.webservicex.net']", doc);
    }
View Full Code Here

       
        List exts = new ArrayList();
        exts.add(new CustomExtension());
        factory.setWSDLBuilderExtensions(exts);

        Document wsdl = getWSDLDocument("Echo");
        addNamespace("w", WSDLWriter.WSDL11_NS);
        addNamespace("f", "urn:foo");
        assertValid("//w:message[@name='Test']", wsdl);
    }
View Full Code Here

        JDOMEndpoint endpoint = new JDOMEndpoint();
        channel2.setEndpoint(endpoint);
       
        // Document to send
        StaxBuilder builder = new StaxBuilder();
        Document doc = builder.build(getResourceAsStream("/org/codehaus/xfire/xmpp/echo.xml"));

        MessageContext context = new MessageContext();

        OutMessage msg = new OutMessage(id + "/" + peer2);
        msg.setSerializer(new SoapSerializer(new JDOMSerializer()));
View Full Code Here

        Binding binding = echo.getBinding(XMPPTransport.BINDING_ID);
        assertNotNull(binding);
       
        // Document to send
        StaxBuilder builder = new StaxBuilder();
        Document doc = builder.build(getResourceAsStream("/org/codehaus/xfire/xmpp/echo.xml"));
       
        MessageContext context = new MessageContext();

        OutMessage msg = new OutMessage(id + "/Echo");
        msg.setSerializer(new SoapSerializer(new JDOMSerializer()));
View Full Code Here

TOP

Related Classes of org.jdom.Document

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.