if (outbound) {
LogicalMessage msg = ctx.getMessage();
assertNotNull("logical message is null", msg);
JAXBContext jaxbCtx = JAXBContext.newInstance(PackageUtils
.getPackageName(PingOneWay.class));
PingResponse resp = new PingResponse();
resp.getHandlersInfo().add(clientHandlerMessage);
msg.setPayload(resp, jaxbCtx);
return false;
}
} catch (Exception e) {
e.printStackTrace();
fail(e.toString());
}
return true;
}
};
TestHandler<LogicalMessageContext> handler3 = new TestHandler<LogicalMessageContext>(false);
TestSOAPHandler soapHandler1 = new TestSOAPHandler(false);
addHandlersToChain((BindingProvider)handlerTest, handler1, handler2, handler3, soapHandler1);
List<String> resp = handlerTest.ping();
assertEquals(clientHandlerMessage, resp.get(0));
assertEquals("the first handler must be invoked twice", 2, handler1.getHandleMessageInvoked());
assertEquals("the second handler must be invoked once only on outbound", 1, handler2
.getHandleMessageInvoked());
assertEquals("the third handler must not be invoked", 0, handler3.getHandleMessageInvoked());