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);