use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfHttpJmsClientServerTest method testClientInvocation.
@Test
public void testClientInvocation() throws MalformedURLException {
String address = ROUTER_ADDRESS.replace("{{routerPort}}", System.getProperty("routerPort"));
Client client = new Client(address + "?wsdl");
Greeter proxy = client.getProxy();
String resp;
resp = proxy.sayHi();
assertEquals("Get a wrong response", "Bonjour", resp);
resp = proxy.greetMe("Willem");
assertEquals("Get a wrong response", "Hello Willem", resp);
proxy.greetMeOneWay(System.getProperty("user.name"));
try {
proxy.pingMe("hello");
fail("exception expected but none thrown");
} catch (PingMeFault ex) {
FaultDetail detail = ex.getFaultInfo();
assertEquals("Wrong FaultDetail major:", 2, detail.getMajor());
assertEquals("Wrong FaultDetail minor:", 1, detail.getMinor());
}
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfConsumerSoap12Test method testInvokeGreeter.
@Test
public void testInvokeGreeter() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
Service service = Service.create(SERVICE_NAME);
service.addPort(PORT_NAME, "http://www.w3.org/2003/05/soap/bindings/HTTP/", "http://localhost:" + CXFTestSupport.getPort1() + "/CxfConsumerSoap12Test/router");
Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
greeter.greetMeOneWay("test");
assertMockEndpointsSatisfied();
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfPayloadProviderRouterTest method testInvokeGreetMeOverProvider.
@Test
public void testInvokeGreetMeOverProvider() throws Exception {
Service service = Service.create(serviceName);
service.addPort(routerPortName, "http://schemas.xmlsoap.org/soap/", "http://localhost:" + CXFTestSupport.getPort2() + "/" + getClass().getSimpleName() + "/CamelContext/RouterPort");
Greeter greeter = service.getPort(routerPortName, Greeter.class);
org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(greeter);
VerifyInboundInterceptor icp = new VerifyInboundInterceptor();
client.getInInterceptors().add(icp);
int ic = implementor.getInvocationCount();
icp.setCalled(false);
String reply = greeter.greetMe("test");
assertEquals("Got the wrong reply ", "Hello test", reply);
assertTrue("No Inbound message received", icp.isCalled());
assertEquals("The target service not invoked", ++ic, implementor.getInvocationCount());
icp.setCalled(false);
greeter.greetMeOneWay("call greetMe OneWay !");
assertFalse("An unnecessary inbound message", icp.isCalled());
// wait a few seconds for the async oneway service to be invoked
Thread.sleep(3000);
assertEquals("The target service not invoked", ++ic, implementor.getInvocationCount());
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfEndpointJMSConsumerTest method testInvocation.
@Test
public void testInvocation() {
// Here we just the address with JMS URI
String address = "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue" + "?jndiInitialContextFactory" + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=" + "vm://localhost";
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(Greeter.class);
factory.setAddress(address);
Greeter greeter = factory.create(Greeter.class);
String response = greeter.greetMe("Willem");
assertEquals("Get a wrong response", "Hello Willem", response);
}
use of org.apache.hello_world_soap_http.Greeter in project camel by apache.
the class CxfPayloadProviderRouterTest method testInvokeGreetMeOverProvider.
@Test
public void testInvokeGreetMeOverProvider() 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);
org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(greeter);
VerifyInboundInterceptor icp = new VerifyInboundInterceptor();
client.getInInterceptors().add(icp);
int ic = implementor.getInvocationCount();
icp.setCalled(false);
String reply = greeter.greetMe("test");
assertEquals("Got the wrong reply ", "Hello test", reply);
assertTrue("No Inbound message received", icp.isCalled());
assertEquals("The target service not invoked", ++ic, implementor.getInvocationCount());
icp.setCalled(false);
greeter.greetMeOneWay("call greetMe OneWay !");
assertFalse("An unnecessary inbound message", icp.isCalled());
// wait a few seconds for the async oneway service to be invoked
Thread.sleep(3000);
assertEquals("The target service not invoked", ++ic, implementor.getInvocationCount());
}
Aggregations