Package org.apache.hello_world_rpclit

Examples of org.apache.hello_world_rpclit.GreeterRPCLit


        assertNotNull(service);

       
        String response1 = new String("TestGreetMeResponseServerLogicalHandlerServerSOAPHandler");
        String response2 = new String("TestSayHiResponse");
        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
        updateAddressPort(greeter, PORT);

        String greeting = greeter.greetMe("Milestone-0");
        assertNotNull("no response received from service", greeting);
        assertEquals(response1, greeting);

        String reply = greeter.sayHi();
        assertNotNull("no response received from service", reply);
        assertEquals(response2, reply);
    }
View Full Code Here


                + "/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit8-stax",
            "http://localhost:" + PORT
                + "/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit8-stream"              
        };
        String response1 = new String("TestGreetMeResponseServerLogicalHandlerServerSOAPHandler");
        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
        for (String ad : addresses) {
            ((BindingProvider)greeter).getRequestContext()
                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ad);
            String greeting = greeter.greetMe("Milestone-0");
            assertNotNull("no response received from service " + ad, greeting);
            assertEquals("wrong response received from service " + ad, response1, greeting);
        }
    }
View Full Code Here

        assertNotNull(service);
       
        String response1 = new String("Hello Milestone-");
        String response2 = new String("Bonjour");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            updateAddressPort(greeter, PORT);
            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);
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
View Full Code Here

    @Test
    public void testComplexType() throws Exception {
        SOAPServiceRPCLit service = new SOAPServiceRPCLit();
        assertNotNull(service);

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

        MyComplexStruct in = new MyComplexStruct();
        in.setElem1("elem1");
        in.setElem2("elem2");
        in.setElem3(45);

        try {           
            ((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", Boolean.TRUE);
            MyComplexStruct out = greeter.sendReceiveData(in);
            assertNotNull("no response received from service", out);
            assertEquals(in.getElem1(), out.getElem1());
            assertEquals(in.getElem2(), out.getElem2());
            assertEquals(in.getElem3(), out.getElem3());
           
           
           
        } catch (UndeclaredThrowableException ex) {
            throw (Exception) ex.getCause();
        }
       
        try {
            in.setElem2("invalid");
            greeter.sendReceiveData(in);
        } catch (SOAPFaultException f) {
            assertTrue(f.getCause() instanceof UnmarshalException);
        }
    }
View Full Code Here

                                 int count,
                                 boolean doFault) throws Exception {
        String response1 = new String("TestGreetMeResponse");
        String response2 = new String("TestSayHiResponse");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            updateAddressPort(greeter, PORT);
            for (int idx = 0; idx < count; idx++) {
                String greeting = greeter.greetMe("Milestone-" + idx);
                assertNotNull("no response received from service", greeting);
                assertEquals(response1, greeting);

                String reply = greeter.sayHi();
                assertNotNull("no response received from service", reply);
                assertEquals(response2, reply);
               
                if (doFault) {
                    try {
                        greeter.greetMe("throwFault");
                    } catch (SOAPFaultException ex) {
                        assertNotNull(ex.getFault().getDetail());
                        assertTrue(ex.getFault().getDetail().getDetailEntries().hasNext());
                    }
                }
View Full Code Here

        assertNotNull(service);
       
        String response1 = new String("Hello Milestone-");
        String response2 = new String("Bonjour");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            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);
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
View Full Code Here

    @Test
    public void testComplexType() throws Exception {
        SOAPServiceRPCLit service = new SOAPServiceRPCLit();
        assertNotNull(service);

        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);

        MyComplexStruct in = new MyComplexStruct();
        in.setElem1("elem1");
        in.setElem2("elem2");
        in.setElem3(45);

        try {           
            MyComplexStruct out = greeter.sendReceiveData(in);
            assertNotNull("no response received from service", out);
            assertEquals(in.getElem1(), out.getElem1());
            assertEquals(in.getElem2(), out.getElem2());
            assertEquals(in.getElem3(), out.getElem3());
        } catch (UndeclaredThrowableException ex) {
View Full Code Here

    }

    @Test
    public void testRespectBindingFeature() throws Exception {
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class,
                                                    new RespectBindingFeature(true));
            updateAddressPort(greeter, PORT);
            greeter.greetMe("hello");
            fail("WebServiceException is expected");
        } catch (Exception ex) {
            assertTrue("WebServiceException is expected", ex instanceof javax.xml.ws.WebServiceException);
            assertTrue("RespectBindingFeature message is expected: " + ex.getMessage(),
                       ex.getMessage().indexOf("extension with required=true attribute") > -1);
View Full Code Here

    }

    @Test
    public void testRespectBindingFeatureFalse() throws Exception {

        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class,
                                                new RespectBindingFeature(false));
        updateAddressPort(greeter, PORT);
        assertEquals("Bonjour" , greeter.sayHi());
    }
View Full Code Here

        assertNotNull(service);
       
        String response1 = new String("Hello Milestone-");
        String response2 = new String("Bonjour");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            updateAddressPort(greeter, PORT);
            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);
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
View Full Code Here

TOP

Related Classes of org.apache.hello_world_rpclit.GreeterRPCLit

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.