Package org.apache.hello_world_soap_http

Examples of org.apache.hello_world_soap_http.Greeter


   
    public void testClientInvocation() throws Exception {
        startUpJmsBroker();
       
        Client client = new Client(ROUTER_ADDRESS + "?wsdl");
        Greeter proxy = client.getProxy();
       
        String resp;
        resp = proxy.sayHi();
        assertEquals("Get a wrong response", "Bonjour", resp);
      
        resp = proxy.greetMe("Willem");
        assertEquals("Get a wrong response", "Hello Willem", resp);
       
        proxy.greetMeOneWay(System.getProperty("user.name"));

        try {
            proxy.pingMe("hello");
            fail("expect exception here");
        } catch (PingMeFault ex) {
            FaultDetail detail = ex.getFaultInfo();
            assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());
            assertEquals("Wrong FaultDetail minor:", 1, detail.getMinor());
View Full Code Here


   
    public void testClientInvocation() throws Exception {
        startUpServer();
       
        Client client = new Client("http://localhost:9091/GreeterContext/GreeterPort");
        Greeter port = client.getProxy();
       
        assertNotNull("The proxy should not be null", port);
        String resp = port.sayHi();
        assertEquals("Get a wrong response ", "Bonjour from EndpointA", resp);       

        resp = port.sayHi();
        assertEquals("Get a wrong response ", "Bonjour from EndpointB", resp)

      
        resp = port.greetMe("Mike");
        assertEquals("Get a wrong response ", "Hello Mike from EndpointA", resp);
       
        resp = port.greetMe("James");
        assertEquals("Get a wrong response ", "Hello James from EndpointB", resp)
      
        port.greetMeOneWay(System.getProperty("user.name"));

        try {
            System.out.println("Invoking pingMe, expecting exception...");
            port.pingMe("hello");
            fail("expects the exception here");
        } catch (PingMeFault ex) {
            assertEquals("Get a wrong exception message", "PingMeFault raised by server EndpointB", ex.getMessage());
            FaultDetail detail = ex.getFaultInfo();
            assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());
View Full Code Here

    public void testBasicConnection() throws Exception {

        SOAPService service = new SOAPService();
        assertNotNull(service);

        Greeter greeter = service.getPort(portName, Greeter.class);
        updateAddressPort(greeter, PORT);
        try {
            greeter.greetMe("test");
           
            String reply = greeter.sayHi();
            assertNotNull("no response received from service", reply);
            assertEquals("Bonjour", reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

    public void testTimeoutConfigutation() throws Exception {

        SOAPService service = new SOAPService();
        assertNotNull(service);

        Greeter greeter = service.getPort(portName, Greeter.class);
        updateAddressPort(greeter, PORT);
        ((javax.xml.ws.BindingProvider)greeter).getRequestContext().put("javax.xml.ws.client.receiveTimeout",
                                                                        "1");
        try {
            greeter.greetMe("test");
            // remove fail() check to let this test pass in the powerful machine
        } catch (Throwable ex) {
            Object cause = null;
            if (ex.getCause() != null) {
                cause = ex.getCause();
View Full Code Here

    @Test
    public void testNillable() throws Exception {
        SOAPService service = new SOAPService();
        assertNotNull(service);

        Greeter greeter = service.getPort(portName, Greeter.class);
        updateAddressPort(greeter, PORT);

        try {
            String reply = greeter.testNillable("test", 100);
            assertEquals("test", reply);
            reply = greeter.testNillable(null, 100);
            assertNull(reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

    @Test
    public void testAddPortWithSpecifiedSoap12Binding() throws Exception {
        Service service = Service.create(serviceName);
        service.addPort(fakePortName, javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING,
                        "http://localhost:" + PORT + "/SoapContext/SoapPort");
        Greeter greeter = service.getPort(fakePortName, Greeter.class);

        String response = new String("Bonjour");
        try {
            greeter.greetMe("test");
            String reply = greeter.sayHi();
            assertNotNull("no response received from service", reply);
            assertEquals(response, reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

    @Test
    public void testAddPortWithSpecifiedSoap11Binding() throws Exception {
        Service service = Service.create(serviceName);
        service.addPort(fakePortName, javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING,
            "http://localhost:" + PORT + "/SoapContext/SoapPort");
        Greeter greeter = service.getPort(fakePortName, Greeter.class);

        String response = new String("Bonjour");
        try {
            greeter.greetMe("test");
            String reply = greeter.sayHi();
            assertNotNull("no response received from service", reply);
            assertEquals(response, reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

    @Test
    public void testAddPort() throws Exception {
        Service service = Service.create(serviceName);
        service.addPort(fakePortName, "http://schemas.xmlsoap.org/soap/",
                        "http://localhost:" + PORT + "/SoapContext/SoapPort");
        Greeter greeter = service.getPort(fakePortName, Greeter.class);

        String response = new String("Bonjour");
        try {
            greeter.greetMe("test");
            String reply = greeter.sayHi();
            assertNotNull("no response received from service", reply);
            assertEquals(response, reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

    public void testGetPortOneParam() throws Exception {

        URL url = getClass().getResource("/wsdl/hello_world.wsdl");
        Service service = Service.create(url, serviceName);
       
        Greeter greeter = service.getPort(Greeter.class);
        String response = new String("Bonjour");
        
        try {
            ((BindingProvider)greeter).getRequestContext()
                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                     "http://localhost:" + PORT + "/SoapContext/SoapPort");
            greeter.greetMe("test");
            String reply = greeter.sayHi();
            assertNotNull("no response received from service", reply);
            assertEquals(response, reply);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here

        assertNotNull(wsdl);
       
        SOAPService service = new SOAPService(wsdl, serviceName);
        assertNotNull(service);
       
        Greeter greeter = service.getPort(portName, Greeter.class);
        updateAddressPort(greeter, PORT);
       
        String response1 = new String("Hello Milestone-");
        String response2 = new String("Bonjour");
        try {      
            for (int idx = 0; idx < 1; idx++) {
                String greeting = greeter.greetMe("Milestone-" + idx);
                assertNotNull("no response received from service", greeting);
                String exResponse = response1 + idx;
                assertEquals(exResponse, greeting);
               
                String reply = greeter.sayHi();
                assertNotNull("no response received from service", reply);
                assertEquals(response2, reply);

                greeter.greetMeOneWay("Milestone-" + idx);
               
               
               
            }           
        } catch (UndeclaredThrowableException ex) {
View Full Code Here

TOP

Related Classes of org.apache.hello_world_soap_http.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.