use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.
the class Client method getProxy.
public static LoanBrokerWS getProxy(String address) {
// Now we use the simple front API to create the client proxy
ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
clientBean.setAddress(address);
clientBean.setServiceClass(LoanBrokerWS.class);
// just create a new bus for use
clientBean.setBus(BusFactory.newInstance().createBus());
return (LoanBrokerWS) proxyFactory.create();
}
use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.
the class CamelCxfBeanInjectTest method createClient.
private SimpleService createClient() {
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setAddress(ENDPOINT_ADDRESS);
factory.setServiceClass(SimpleService.class);
factory.setBus(BusFactory.getDefaultBus());
return (SimpleService) factory.create();
}
use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.
the class FailOverFeatureTest method tryFailover.
private String tryFailover(String url) {
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(HelloService.class);
factory.setAddress(url);
HelloService client = (HelloService) factory.create();
return client.sayHello();
}
use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.
the class CxfPayLoadBareSoapTest method testInvokeProxyService.
@Test
public void testInvokeProxyService() {
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(BareSoapService.class);
factory.setAddress(PROXY_URL);
factory.setBus(BusFactory.newInstance().createBus());
BareSoapService client = (BareSoapService) factory.create();
client.doSomething();
assertEquals("Proxied service should have been invoked once", 1, IMPLEMENTATION.invocations.get());
}
use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.
the class LoadDistributorFeatureTest method tryLoadDistributor.
private String tryLoadDistributor(String url) {
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(HelloService.class);
factory.setAddress(url);
HelloService client = (HelloService) factory.create();
return client.sayHello();
}
Aggregations