Package org.apache.cxf.frontend

Examples of org.apache.cxf.frontend.ClientProxyFactoryBean.create()


            props.put("mtom-enabled", Boolean.TRUE);
        }
        proxyFac.setProperties(props);

        client = (org.apache.cxf.systest.aegis.mtom.fortest.MtomTestService)
            proxyFac.create(MtomTestService.class);
        jaxwsClient = jaxwsFac.create(MtomTestService.class);
        impl = (MtomTestImpl)applicationContext.getBean("mtomImpl");
    }

    @Test
View Full Code Here


        HashMap<String, Student> mss = new HashMap<String, Student>();
        mss.put("Alice", new Student());
        HashMap<String, HashMap<String, Student>> mmss = new HashMap<String, HashMap<String, Student>>();
        mmss.put("Bob", mss);

        StudentServiceDocLiteral clientInterface = proxyFac.create(StudentServiceDocLiteral.class);
        clientInterface.takeMapMap(mmss);
        //CHECKSTYLE:ON
    }

    @Test
View Full Code Here

        AegisDatabinding aegisBinding = new AegisDatabinding();
        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
        proxyFactory.setDataBinding(aegisBinding);
        proxyFactory.setServiceClass(AuthService.class);
        proxyFactory.setAddress("http://localhost:" + PORT + "/service");
        AuthService service = (AuthService) proxyFactory.create();
        assertTrue(service.authenticate("Joe", "Joe", "123"));
        assertFalse(service.authenticate("Joe1", "Joe", "fang"));     
        assertTrue(service.authenticate("Joe", null, "123"));
        List<String> list = service.getRoles("Joe");
        assertEquals(3, list.size());
View Full Code Here

        factory.setWsdlURL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl");
        factory.setServiceName(servName);
        factory.setServiceClass(DocLitWrappedCodeFirstService.class);
        factory.setEndpointName(portName);
       
        DocLitWrappedCodeFirstService port = (DocLitWrappedCodeFirstService) factory.create();       
        assertNotNull(port);

        String echoMsg = port.echo("Hello");
        assertEquals("Hello", echoMsg);
    }
View Full Code Here

        if (wsdlLocation != null)
        {
            cpf.setWsdlLocation(wsdlLocation);
        }
       
        Client client = ClientProxy.getClient(cpf.create());

        Binding binding = client.getEndpoint().getBinding();
        CxfUtils.removeInterceptor(binding.getOutInterceptors(), WrappedOutInterceptor.class.getName());
        CxfUtils.removeInterceptor(binding.getInInterceptors(), Soap11FaultInInterceptor.class.getName());
        CxfUtils.removeInterceptor(binding.getInInterceptors(), Soap12FaultInInterceptor.class.getName());
View Full Code Here

        if (wsdlLocation != null)
        {
            cpf.setWsdlLocation(wsdlLocation);
        }

        return ClientProxy.getClient(cpf.create());
    }
}
View Full Code Here

    @Test
    public void testInvokeProxyService() {
        ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
        factory.setServiceClass(BareSoapService.class);
        factory.setAddress(PROXY_URL);
        BareSoapService client = (BareSoapService) factory.create();

        client.doSomething();

        assertEquals("Proxied service should have been invoked once", 1, IMPLEMENTATION.invocations.get());
    }
View Full Code Here

            cls = ClassLoaderUtils.loadClass(getServiceClass(), getClass());
            // create client factory bean
            ClientProxyFactoryBean factoryBean = createClientFactoryBean(cls);
            // setup client factory bean
            setupClientFactoryBean(factoryBean, cls);
            return ((ClientProxy)Proxy.getInvocationHandler(factoryBean.create())).getClient();
        } else {           
            checkName(portName, "endpoint/port name");
            checkName(serviceName, "service name");
            ClientFactoryBean factoryBean = createClientFactoryBean();
            // setup client factory bean
View Full Code Here

            checkName(portName, "endpoint/port name");
            checkName(serviceName, "service name");
            ClientFactoryBean factoryBean = createClientFactoryBean();
            // setup client factory bean
            setupClientFactoryBean(factoryBean);
            return factoryBean.create();
        }
       
    }
   
    void checkName(String value, String name) {
View Full Code Here

        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
        clientBean.setAddress(ROUTER_ADDRESS);
        clientBean.setServiceClass(HelloService.class);
       
        HelloService client = (HelloService) proxyFactory.create();
        return client;
    }

    @Test
    public void testInvokingServiceFromCXFClient() throws Exception {       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.