use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class AbstractCXFGreeterRouterTest method testInvokingServiceFromCXFClient.
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
Service service = Service.create(serviceName);
service.addPort(routerPortName, "http://schemas.xmlsoap.org/soap/", "http://localhost:" + getPort2() + "/" + getClass().getSimpleName() + "/CamelContext/RouterPort");
Greeter greeter = service.getPort(routerPortName, Greeter.class);
String reply = greeter.greetMe("test");
assertNotNull("No response received from service", reply);
assertEquals("Got the wrong reply ", "Hello test", reply);
reply = greeter.sayHi();
assertNotNull("No response received from service", reply);
assertEquals("Got the wrong reply ", "Bonjour", reply);
greeter.greetMeOneWay("call greetMe OneWay !");
// test throw the exception
try {
greeter.testDocLitFault("NoSuchCodeLitFault");
// should get the exception here
fail("Should get the NoSuchCodeLitFault here.");
} catch (NoSuchCodeLitFault fault) {
// expect the fault here
assertNotNull("The fault info should not be null", fault.getFaultInfo());
}
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfTimeoutTest method startService.
@BeforeClass
public static void startService() {
Greeter implementor = new GreeterImplWithSleep();
Endpoint.publish(JAXWS_SERVER_ADDRESS, implementor);
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfMessageHeaderTimeoutTest method startService.
@BeforeClass
public static void startService() {
Greeter implementor = new GreeterImplWithSleep();
Endpoint.publish(SERVER_ADDRESS, implementor);
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfOneWayRouteTest method getCXFClient.
protected Greeter getCXFClient() throws Exception {
Service service = Service.create(SERVICE_NAME);
service.addPort(PORT_NAME, "http://schemas.xmlsoap.org/soap/", ROUTER_ADDRESS);
Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
return greeter;
}
use of org.apache.hello_world_soap_http.Greeter in project cxf by apache.
the class DirectDispatchClientTest method invokeService.
private void invokeService(boolean isDirectDispatch) {
BusFactory.setThreadDefaultBus(staticBus);
Service service = Service.create(serviceName);
service.addPort(localPortName, "http://schemas.xmlsoap.org/soap/", "local://Greeter");
Greeter greeter = service.getPort(localPortName, Greeter.class);
if (isDirectDispatch) {
Client client = ClientProxy.getClient(greeter);
client.getOutInterceptors().add(new GZIPOutInterceptor(50));
client.getInInterceptors().add(new GZIPInInterceptor());
InvocationHandler handler = Proxy.getInvocationHandler(greeter);
BindingProvider bp = null;
if (handler instanceof BindingProvider) {
bp = (BindingProvider) handler;
Map<String, Object> requestContext = bp.getRequestContext();
requestContext.put(LocalConduit.DIRECT_DISPATCH, true);
}
}
String reply = greeter.greetMe("test");
assertEquals("Hello test", reply);
reply = greeter.sayHi();
assertNotNull("no response received from service", reply);
assertEquals("Bonjour", reply);
}
Aggregations