Package org.apache.hello_world_rpclit

Examples of org.apache.hello_world_rpclit.GreeterRPCLit


        assertNotNull(service);

       
        String response1 = new String("TestGreetMeResponseServerLogicalHandlerServerSOAPHandler");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            String greeting = greeter.greetMe("Milestone-0");
            assertNotNull("no response received from service", greeting);
            assertEquals(response1, greeting);
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
View Full Code Here


    private void doGreeterRPCLit(SOAPServiceRPCLit service, QName portName, int count) throws Exception {
        String response1 = new String("TestGreetMeResponse");
        String response2 = new String("TestSayHiResponse");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            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);
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
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);
            ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
            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);
                try {
                    greeter.greetMe("return null");
                    fail("should catch WebServiceException");
                } catch (WebServiceException e) {
                    //do nothing
                } catch (Exception e) {
                    fail("should catch WebServiceException");
                    throw e;
                }
               
                try {
                    greeter.greetMe(null);
                    fail("should catch WebServiceException");
                } catch (WebServiceException e) {
                    //do nothing
                } catch (Exception e) {
                    fail("should catch WebServiceException");
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

        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

                                 boolean doFault,
                                 String address) throws Exception {
        String response1 = new String("TestGreetMeResponse");
        String response2 = new String("TestSayHiResponse");
        try {
            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
            if (address != null) {
                ((BindingProvider)greeter).getRequestContext()
                    .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
            }
            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

    @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 {           
            ((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

        assertNotNull(service);

       
        String response1 = new String("TestGreetMeResponseServerLogicalHandlerServerSOAPHandler");
        String response2 = new String("TestSayHiResponse");
        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
        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

            "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit8-cxfstax",
            "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit8-stax",
            "http://localhost:9008/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

                                 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

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.