Package org.apache.hello_world_xml_http.wrapped

Examples of org.apache.hello_world_xml_http.wrapped.XMLService


    @Test
    public void testInvokeWithDOMSourcMessageModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.MESSAGE);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
View Full Code Here


    @Test
    public void testInvokeWithDOMSourcPayloadModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.PAYLOAD);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
View Full Code Here

    @Test
    public void testInvokeWithDataSourcMessageModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        Dispatch<DataSource> disp = service.createDispatch(portNameXML, DataSource.class, Mode.MESSAGE);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
View Full Code Here

    @Test
    public void testInvokeWithDataSourcPayloadModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        Dispatch<DataSource> disp = service.createDispatch(portNameXML, DataSource.class, Mode.PAYLOAD);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
View Full Code Here

    @Test
    public void testInvokeWithJAXBMessageModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_xml_http.wrapped.types");
        Dispatch<Object> disp = service.createDispatch(portNameXML, jc, Mode.MESSAGE);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        org.apache.hello_world_xml_http.wrapped.types.GreetMe req =
View Full Code Here

    @Test
    public void testInvokeWithJAXBPayloadModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_xml_http.wrapped.types");
        Dispatch<Object> disp = service.createDispatch(portNameXML, jc, Mode.PAYLOAD);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);

        org.apache.hello_world_xml_http.wrapped.types.GreetMe req =
View Full Code Here

    @Test
    public void testDOMSourcePAYLOAD() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/hello_world_xml_wrapped.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is = getClass().getResourceAsStream(
                "/messages/XML_GreetMeDocLiteralReq.xml");
        Document doc = XMLUtils.parse(is);
        DOMSource reqMsg = new DOMSource(doc);
        assertNotNull(reqMsg);

        Dispatch<DOMSource> disp = service.createDispatch(portName,
                DOMSource.class, Service.Mode.PAYLOAD);
        DOMSource result = disp.invoke(reqMsg);
        assertNotNull(result);

        Node respDoc = result.getNode();
        assertEquals("greetMeResponse", respDoc.getFirstChild().getLocalName());
        assertEquals("TestXMLBindingProviderMessage", respDoc.getFirstChild()
                .getTextContent());
       
        is = getClass().getResourceAsStream(
            "/messages/XML_GreetMeDocLiteralReq_invalid.xml");
        doc = XMLUtils.parse(is);
        reqMsg = new DOMSource(doc);
        assertNotNull(reqMsg);

        disp = service.createDispatch(portName,
                                      DOMSource.class, Service.Mode.PAYLOAD);
       
        try {
            result = disp.invoke(reqMsg);
            fail("should have a schema validation exception of some sort");
View Full Code Here

    @Test
    public void testDOMSourcePAYLOAD() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/hello_world_xml_wrapped.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService(wsdl, SERVICE_NAME);
        assertNotNull(service);

        InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
        Document doc = XMLUtils.parse(is);
        DOMSource reqMsg = new DOMSource(doc);
        assertNotNull(reqMsg);

        Dispatch<DOMSource> disp = service.createDispatch(PORT_NAME, DOMSource.class,
                                                          Service.Mode.PAYLOAD);
        disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                     "http://localhost:"
                                     + port
                                     + "/XMLService/XMLDispatchPort");
View Full Code Here

    @Test
    public void testDOMSourcePAYLOAD() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/hello_world_xml_wrapped.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService(wsdl, serviceName);
        assertNotNull(service);

        InputStream is = getClass().getResourceAsStream(
                "/messages/XML_GreetMeDocLiteralReq.xml");
        Document doc = XMLUtils.parse(is);
        DOMSource reqMsg = new DOMSource(doc);
        assertNotNull(reqMsg);

        Dispatch<DOMSource> disp = service.createDispatch(portName,
                DOMSource.class, Service.Mode.PAYLOAD);
        setAddress(disp, ADDRESS);
        DOMSource result = disp.invoke(reqMsg);
        assertNotNull(result);

        Node respDoc = result.getNode();
        assertEquals("greetMeResponse", respDoc.getFirstChild().getLocalName());
        assertEquals("TestXMLBindingProviderMessage", respDoc.getFirstChild()
                .getTextContent());
       
        is = getClass().getResourceAsStream(
            "/messages/XML_GreetMeDocLiteralReq_invalid.xml");
        doc = XMLUtils.parse(is);
        reqMsg = new DOMSource(doc);
        assertNotNull(reqMsg);

        disp = service.createDispatch(portName,
                                      DOMSource.class, Service.Mode.PAYLOAD);
       
        try {
            result = disp.invoke(reqMsg);
            fail("should have a schema validation exception of some sort");
View Full Code Here

    @Test
    public void testInvokeWithDOMSourcMessageModeXMLBinding() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
        assertNotNull(wsdl);

        XMLService service = new XMLService();
        assertNotNull(service);

        Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.MESSAGE);
        setAddress(disp, addNumbersAddress);

        TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
        addHandlersProgrammatically(disp, handler);
View Full Code Here

TOP

Related Classes of org.apache.hello_world_xml_http.wrapped.XMLService

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.