use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class ReportIncidentRoutesTest method createCXFClient.
protected static ReportIncidentEndpoint createCXFClient() {
// we use CXF to create a client for us as its easier than JAXWS and works
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ReportIncidentEndpoint.class);
factory.setAddress(url);
return (ReportIncidentEndpoint) factory.create();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class CreditScoreProcessor method getProxy.
private CreditAgencyWS getProxy() {
// Here we use JaxWs front end to create the proxy
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
clientBean.setAddress(creditAgencyAddress);
clientBean.setServiceClass(CreditAgencyWS.class);
clientBean.setBus(BusFactory.getDefaultBus());
return (CreditAgencyWS) proxyFactory.create();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class PayLoadConvertToPOJOTest method testClient.
@Test
public void testClient() throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("http://localhost:" + getPort1() + "/" + getClass().getSimpleName() + "/CamelContext/RouterPort");
factory.setServiceClass(Person.class);
Person person = factory.create(Person.class);
GetPerson payload = new GetPerson();
payload.setPersonId("1234");
GetPersonResponse reply = person.getPerson(payload);
assertEquals("Get the wrong person id.", "1234", reply.getPersonId());
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class JaxWsWebFaultAnnotationToFaultTest method testInvokingServiceFromCXFClient.
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
clientBean.setAddress(ROUTER_ADDRESS);
clientBean.setServiceClass(Greeter.class);
Greeter client = (Greeter) proxyFactory.create();
try {
client.pingMe();
fail("Expect to get an exception here");
} catch (PingMeFault expected) {
assertEquals(MESSAGE, expected.getMessage());
} catch (Throwable t) {
t.printStackTrace();
fail("The CXF client did not manage to map the client exception " + t.getClass().getName() + " to a " + PingMeFault.class.getName() + ": " + t.getMessage());
}
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.
the class JaxWSCamelTestSupport method getSampleWSWithCXFAPI.
public SampleWS getSampleWSWithCXFAPI(String camelEndpoint) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("camel://" + camelEndpoint);
factory.setServiceClass(SampleWS.class);
factory.setBus(bus);
return factory.create(SampleWS.class);
}
Aggregations