Search in sources :

Example 6 with ClientProxyFactoryBean

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();
}
Also used : ClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Example 7 with ClientProxyFactoryBean

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();
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Example 8 with ClientProxyFactoryBean

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();
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Example 9 with ClientProxyFactoryBean

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());
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) Test(org.junit.Test)

Example 10 with ClientProxyFactoryBean

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();
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Aggregations

ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)17 ClientFactoryBean (org.apache.cxf.frontend.ClientFactoryBean)11 Test (org.junit.Test)6 IOException (java.io.IOException)1 IncidentService (org.apache.camel.example.cxf.incident.IncidentService)1 SoapFault (org.apache.cxf.binding.soap.SoapFault)1 Client (org.apache.cxf.endpoint.Client)1 LoggingOutInterceptor (org.apache.cxf.interceptor.LoggingOutInterceptor)1 HTTPConduit (org.apache.cxf.transport.http.HTTPConduit)1 HTTPClientPolicy (org.apache.cxf.transports.http.configuration.HTTPClientPolicy)1