use of org.apache.hello_world_soap_http.PingMeFault in project camel by apache.
the class GreeterImpl method pingMe.
public void pingMe(String messageIn) throws PingMeFault {
FaultDetail faultDetail = new FaultDetail();
faultDetail.setMajor((short) 2);
faultDetail.setMinor((short) 1);
LOG.info("Executing operation pingMe, throwing PingMeFault exception, message = " + messageIn);
System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
throw new PingMeFault("PingMeFault raised by server", faultDetail);
}
use of org.apache.hello_world_soap_http.PingMeFault in project camel by apache.
the class CamelGreeterConsumerTest method testInvokeServers.
@Test
public void testInvokeServers() throws Exception {
assertNotNull(camelContext);
ProducerTemplate template = camelContext.createProducerTemplate();
List<String> params = new ArrayList<String>();
params.add("Willem");
Object result = template.sendBodyAndHeader("cxf://bean:serviceEndpoint", ExchangePattern.InOut, params, CxfConstants.OPERATION_NAME, "greetMe");
assertTrue("Result is a list instance ", result instanceof List);
assertEquals("Get the wrong response", ((List<?>) result).get(0), "HelloWillem");
try {
template.sendBodyAndHeader("cxf://bean:serviceEndpoint", ExchangePattern.InOut, params, CxfConstants.OPERATION_NAME, "pingMe");
fail("Expect exception here.");
} catch (Exception ex) {
assertTrue("Get a wrong exception.", ex instanceof CamelExecutionException);
assertTrue("Get a wrong exception cause. ", ex.getCause() instanceof PingMeFault);
}
template.stop();
}
use of org.apache.hello_world_soap_http.PingMeFault in project camel by apache.
the class GreeterImpl method pingMe.
public void pingMe(String messageIn) throws PingMeFault {
FaultDetail faultDetail = new FaultDetail();
faultDetail.setMajor((short) 2);
faultDetail.setMinor((short) 1);
LOG.info("Executing operation pingMe, throwing PingMeFault exception, message = " + messageIn);
LOG.info("Executing operation pingMe, throwing PingMeFault exception\n");
throw new PingMeFault("PingMeFault raised by server", faultDetail);
}
Aggregations