Package org.apache.cxf.greeter_control

Examples of org.apache.cxf.greeter_control.GreeterService


   
   
    @Test   
    public void testInvocationWithSession() throws Exception {

        GreeterService service = new GreeterService();
        assertNotNull(service);

        try {
            Greeter greeter = service.getGreeterPort();
           
            BindingProvider bp = (BindingProvider)greeter;
            updateAddressPort(bp, PORT);
            bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
           
View Full Code Here


    }
   
    @Test   
    public void testInvocationWithoutSession() throws Exception {

        GreeterService service = new GreeterService();
        assertNotNull(service);

        try {
            Greeter greeter = service.getGreeterPort();
            updateAddressPort(greeter, PORT);

            String greeting = greeter.greetMe("Bonjour");
           
            assertNotNull("no response received from service", greeting);
View Full Code Here

    public void testInvocationWithSessionAnnotation() throws Exception {
        doSessionsTest("http://localhost:" + PORT + "/Stateful2");
    }
    @Test   
    public void testInvocationWithPerRequestAnnotation() throws Exception {
        GreeterService service = new GreeterService();
        assertNotNull(service);

        Greeter greeter = service.getGreeterPort();
        BindingProvider bp = (BindingProvider)greeter;
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                   "http://localhost:" + PORT + "/PerRequest");
        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
        String result = greeter.greetMe("World");
View Full Code Here

        assertEquals("Hello World", result);
        assertEquals("Bonjour default", greeter.sayHi());
    }
    @Test   
    public void testInvocationWithSpringBeanAnnotation() throws Exception {
        GreeterService service = new GreeterService();
        assertNotNull(service);

        Greeter greeter = service.getGreeterPort();
        BindingProvider bp = (BindingProvider)greeter;
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                   "http://localhost:" + PORT + "/SpringBean");
        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
        String result = greeter.greetMe("World");
View Full Code Here

    }
   
    @Test   
    public void testOnewayInvocationWithSession() throws Exception {

        GreeterService service = new GreeterService();
        assertNotNull(service);

        try {
            Greeter greeter = service.getGreeterPort();
           
            BindingProvider bp = (BindingProvider)greeter;
            updateAddressPort(bp, PORT);
            bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
           
View Full Code Here

            throw (Exception)ex.getCause();
        }
    }
   
    private void doSessionsTest(String url) {
        GreeterService service = new GreeterService();
        assertNotNull(service);

        Greeter greeter = service.getGreeterPort();
        Greeter greeter2 = service.getGreeterPort();
       
        BindingProvider bp = (BindingProvider)greeter;

        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
View Full Code Here

        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
        QName serviceName = new QName("http://cxf.apache.org/greeter_control", "GreeterService");
        URL wsdl = new ClassPathResource("/wsdl/greeter_control.wsdl").getURL();
        GreeterService gs = new GreeterService(wsdl, serviceName);
        final Greeter greeter = gs.getGreeterPort();
        LOG.fine("Created greeter client.");

        ConnectionHelper.setKeepAliveConnection(greeter, true);

View Full Code Here

        outRecorder = new OutMessageRecorder();
        greeterBus.getOutInterceptors().add(outRecorder);
        inRecorder = new InMessageRecorder();
        greeterBus.getInInterceptors().add(inRecorder);

        GreeterService gs = new GreeterService(wsdl, GREETER_SERVICE);
        greeter = gs.getGreeterPort();
        LOG.fine("Created greeter client.");

        ConnectionHelper.setKeepAliveConnection(greeter, true);

        greeter.greetMeOneWay("once");
View Full Code Here

        try {
            wsdl = new ClassPathResource("/wsdl/greeter_control.wsdl").getURL();
        } catch (IOException e) {
            // TODO Auto-generated catch block
        }
        GreeterService gs = new GreeterService(wsdl, GREETER_SERVICE);

        if (null != executor) {
            gs.setExecutor(executor);
        }

        greeter = gs.getGreeterPort();
       
        //      set timeout to 30 secs to avoid intermitly failed
        ((ClientImpl)ClientProxy.getClient(greeter)).setSynchronousTimeout(30000);
       
        LOG.fine("Created greeter client.");
View Full Code Here

        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
        QName serviceName = new QName("http://cxf.apache.org/greeter_control", "GreeterService");
        URL wsdl = new ClassPathResource("/wsdl/greeter_control.wsdl").getURL();
        GreeterService gs = new GreeterService(wsdl, serviceName);
        final Greeter greeter = gs.getGreeterPort();
        LOG.fine("Created greeter client.");
      
        ConnectionHelper.setKeepAliveConnection(greeter, true);

               
View Full Code Here

TOP

Related Classes of org.apache.cxf.greeter_control.GreeterService

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.