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 fabric8 by jboss-fuse.
the class LoadBalanceClientServerTest method testClientServer.
@Test
public void testClientServer() throws Exception {
assertNotNull(bus);
// The bus is load the feature
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceBean(new HelloImpl());
factory.setAddress("http://localhost:9000/simple/server");
factory.setBus(bus);
factory.create();
// sleep a while to let the service be published
for (int i = 0; i < 100; i++) {
if (!feature.getLoadBalanceStrategy().getAlternateAddressList().isEmpty()) {
break;
}
Thread.sleep(100);
}
JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setServiceClass(Hello.class);
// The address is not the actual address that the client will access
clientFactory.setAddress("http://someotherplace");
List<AbstractFeature> features = new ArrayList<AbstractFeature>();
features.add(feature);
// we need to setup the feature on the clientfactory
clientFactory.setFeatures(features);
Hello hello = clientFactory.create(Hello.class);
String response = hello.sayHello();
assertEquals("Get a wrong response", "Hello", response);
response = hello.sayHello();
assertEquals("Get a wrong response", "Hello", response);
// Try to call the hello proxy which is created by Spring with setting feature on the bus
response = helloProxy.sayHello();
assertEquals("Get a wrong response", "Hello", response);
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.
the class ChargePointService12_InvokerImpl method create.
private static ChargePointService create(ChargePointSelect cp) {
JaxWsProxyFactoryBean f = ClientProvider.getBean(cp.getEndpointAddress());
f.setServiceClass(ChargePointService.class);
return (ChargePointService) f.create();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.
the class ChargePointService16_InvokerImpl method create.
private static ChargePointService create(ChargePointSelect cp) {
JaxWsProxyFactoryBean f = ClientProvider.getBean(cp.getEndpointAddress());
f.setServiceClass(ChargePointService.class);
return (ChargePointService) f.create();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.
the class ApplicationTest method getForOcpp15.
private static ocpp.cs._2012._06.CentralSystemService getForOcpp15() {
JaxWsProxyFactoryBean f = getBean(path);
f.setServiceClass(ocpp.cs._2012._06.CentralSystemService.class);
return (ocpp.cs._2012._06.CentralSystemService) f.create();
}
Aggregations