Package org.apache.hello_world_soap_http_source.source

Examples of org.apache.hello_world_soap_http_source.source.Greeter


        BusFactory.setDefaultBus(bus);
        URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/source/hello_world.wsdl");
        assertNotNull("We should have found the WSDL here. " , wsdl);     
       
        SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
        Greeter port = ss.getSoapPort();
        updateAddressPort(port, WSDL_PORT);
       
        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
        ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
       
        Document doc = XMLUtils.newDocument();
        doc.appendChild(doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                                            "ns1:sayHi"));
        DOMSource ds = new DOMSource(doc);
        DOMSource resp = port.sayHi(ds);
        assertEquals("We should get the right response", "Bonjour",
                     DOMUtils.getContent(getElement(resp.getNode().getFirstChild().getFirstChild())));
       
        doc = XMLUtils.newDocument();
        Element el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:greetMe");
        Element el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:requestType");
        el2.appendChild(doc.createTextNode("Willem"));
        el.appendChild(el2);
        doc.appendChild(el);
        ds = new DOMSource(doc);
        resp = port.greetMe(ds);
        assertEquals("We should get the right response", "Hello Willem",
                     DOMUtils.getContent(DOMUtils.getFirstElement(getElement(resp.getNode()))));

        try {
            doc = XMLUtils.newDocument();
            el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:greetMe");
            el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:requestType");
            el2.appendChild(doc.createTextNode("fault"));
            el.appendChild(el2);
            doc.appendChild(el);
            ds = new DOMSource(doc);
            port.greetMe(ds);
            fail("Should have been a fault");
        } catch (GreetMeFault ex) {
            assertEquals("Some fault detail", DOMUtils.getContent(getElement(ex.getFaultInfo().getNode())));
        }
View Full Code Here


        BusFactory.setDefaultBus(bus);
        URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/source/hello_world.wsdl");
        assertNotNull("We should have found the WSDL here. " , wsdl);     
       
        SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
        Greeter port = ss.getSoapPort();
        updateAddressPort(port, WSDL_PORT);
       
        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
        ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
       
        Document doc = DOMUtils.newDocument();
        doc.appendChild(doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                                            "ns1:sayHi"));
        DOMSource ds = new DOMSource(doc);
        DOMSource resp = port.sayHi(ds);
        assertEquals("We should get the right response", "Bonjour",
                     DOMUtils.getContent(getElement(resp.getNode().getFirstChild().getFirstChild())));
       
        doc = DOMUtils.newDocument();
        Element el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:greetMe");
        Element el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:requestType");
        el2.appendChild(doc.createTextNode("Willem"));
        el.appendChild(el2);
        doc.appendChild(el);
        ds = new DOMSource(doc);
        resp = port.greetMe(ds);
        assertEquals("We should get the right response", "Hello Willem",
                     DOMUtils.getContent(DOMUtils.getFirstElement(getElement(resp.getNode()))));

        try {
            doc = DOMUtils.newDocument();
            el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:greetMe");
            el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:requestType");
            el2.appendChild(doc.createTextNode("fault"));
            el.appendChild(el2);
            doc.appendChild(el);
            ds = new DOMSource(doc);
            port.greetMe(ds);
            fail("Should have been a fault");
        } catch (GreetMeFault ex) {
            assertEquals("Some fault detail", DOMUtils.getContent(getElement(ex.getFaultInfo().getNode())));
        }
View Full Code Here

        BusFactory.setDefaultBus(bus);
        URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/source/hello_world.wsdl");
        assertNotNull("We should have found the WSDL here. " , wsdl);     
       
        SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
        Greeter port = ss.getSoapPort();
        updateAddressPort(port, WSDL_PORT);
       
        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
        ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
       
        Document doc = XMLUtils.newDocument();
        doc.appendChild(doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                                            "ns1:sayHi"));
        DOMSource ds = new DOMSource(doc);
        DOMSource resp = port.sayHi(ds);
        assertEquals("We should get the right response", "Bonjour",
                     DOMUtils.getContent(getElement(resp.getNode())));
       
        doc = XMLUtils.newDocument();
        Element el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:greetMe");
        Element el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
            "ns1:requestType");
        el2.appendChild(doc.createTextNode("Willem"));
        el.appendChild(el2);
        doc.appendChild(el);
        ds = new DOMSource(doc);
        resp = port.greetMe(ds);
        assertEquals("We should get the right response", "Hello Willem",
                     DOMUtils.getContent(DOMUtils.getFirstElement(getElement(resp.getNode()))));

        try {
            doc = XMLUtils.newDocument();
            el = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:greetMe");
            el2 = doc.createElementNS("http://apache.org/hello_world_soap_http_source/source/types",
                "ns1:requestType");
            el2.appendChild(doc.createTextNode("fault"));
            el.appendChild(el2);
            doc.appendChild(el);
            ds = new DOMSource(doc);
            port.greetMe(ds);
            fail("Should have been a fault");
        } catch (GreetMeFault ex) {
            assertEquals("Some fault detail", DOMUtils.getContent(getElement(ex.getFaultInfo().getNode())));
        }
View Full Code Here

TOP

Related Classes of org.apache.hello_world_soap_http_source.source.Greeter

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.