Search in sources :

Example 1 with ClientProxyFactoryBean

use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.

the class CamelRouteClient method createCXFClient.

protected static IncidentService createCXFClient() {
    // we use CXF to create a client for us as its easier than JAXWS and works
    ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
    factory.setServiceClass(IncidentService.class);
    factory.setAddress(URL);
    return (IncidentService) factory.create();
}
Also used : IncidentService(org.apache.camel.example.cxf.incident.IncidentService) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Example 2 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 3 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 4 with ClientProxyFactoryBean

use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.

the class CxfSimpleRouterTest method getCXFClient.

protected HelloService getCXFClient() throws Exception {
    ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(getRouterAddress());
    clientBean.setServiceClass(HelloService.class);
    HelloService client = (HelloService) proxyFactory.create();
    return client;
}
Also used : ClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Example 5 with ClientProxyFactoryBean

use of org.apache.cxf.frontend.ClientProxyFactoryBean in project camel by apache.

the class CxfMixedModeRouterTest method getCXFClient.

protected HelloService getCXFClient() throws Exception {
    ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ROUTER_ADDRESS);
    clientBean.setServiceClass(HelloService.class);
    clientBean.setBus(BusFactory.newInstance().createBus());
    HelloService client = (HelloService) proxyFactory.create();
    return client;
}
Also used : ClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean)

Aggregations

ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)43 Test (org.junit.Test)23 AegisDatabinding (org.apache.cxf.aegis.databinding.AegisDatabinding)12 ClientFactoryBean (org.apache.cxf.frontend.ClientFactoryBean)12 AbstractAegisTest (org.apache.cxf.aegis.AbstractAegisTest)10 Client (org.apache.cxf.endpoint.Client)4 Server (org.apache.cxf.endpoint.Server)4 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)4 ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)3 BeanInvoker (org.apache.cxf.service.invoker.BeanInvoker)3 Before (org.junit.Before)3 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)3 Document (org.w3c.dom.Document)3 CustomerService (com.example.customerservice.CustomerService)2 HashMap (java.util.HashMap)2 QName (javax.xml.namespace.QName)2 AegisContext (org.apache.cxf.aegis.AegisContext)2 JaxbElementTest (org.apache.cxf.jaxb_element_test.JaxbElementTest)2 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 Service (org.apache.cxf.service.Service)2