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

        assertEquals("Hello World", result);
        assertEquals("Bonjour World", greeter.sayHi());
    }
   
    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

        inRecorder = new InMessageRecorder();
        greeterBus.getInInterceptors().add(inRecorder);
    }

    private void initProxy(boolean useDecoupledEndpoint, Executor executor) {       
        GreeterService gs = new GreeterService();

        if (null != executor) {
            gs.setExecutor(executor);
        }
  
        greeter = gs.getGreeterPort();
        try {
            updateAddressPort(greeter, PORT);
        } catch (Exception e) {
            //ignore
        }
View Full Code Here

        bus.getInFaultInterceptors().add(in);
        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
       
        GreeterService gs = new GreeterService();
        final Greeter greeter = gs.getGreeterPort();
        updateAddressPort(greeter, PORT);
        ((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled",
                                                           shouldValidate());
        LOG.fine("Created greeter client.");
      
View Full Code Here

        bus.getOutFaultInterceptors().add(out);
       
        bus.getExtension(RMManager.class).getRMAssertion().getBaseRetransmissionInterval()
        .setMilliseconds(new Long(5000));
       
        GreeterService gs = new GreeterService();
        final Greeter greeter = gs.getGreeterPort();
        updateAddressPort(greeter, DecoupledClientServerTest.PORT);
        LOG.fine("Created greeter client.");
      
        ConnectionHelper.setKeepAliveConnection(greeter, true);
        RMManager manager = bus.getExtension(RMManager.class);
View Full Code Here

        inRecorder = new InMessageRecorder();
        greeterBus.getInInterceptors().add(inRecorder);
    }

    private void initDispatch(boolean useDecoupledEndpoint) {
        GreeterService gs = new GreeterService();
        dispatch = gs.createDispatch(GreeterService.GreeterPort,
                                     DOMSource.class,
                                     Service.Mode.MESSAGE);
        try {
            updateAddressPort(dispatch, PORT);
        } catch (Exception e) {
View Full Code Here

            initDecoupledEndpoint(((DispatchImpl)dispatch).getClient());
        }
    }

    private void initProxy(boolean useDecoupledEndpoint, Executor executor) {       
        GreeterService gs = new GreeterService();

        if (null != executor) {
            gs.setExecutor(executor);
        }
  
        greeter = gs.getGreeterPort();
        try {
            updateAddressPort(greeter, PORT);
        } catch (Exception e) {
            //ignore
        }
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.