URL wsdl = getClass().getResource("/wsdl/greeter_control.wsdl");
greeterService = new GreeterService(wsdl, SERVICE_NAME);
greeter = greeterService.getPort(PORT_NAME, Greeter.class);
BindingProvider provider = (BindingProvider)greeter;
AbstractBindingImpl abi = (AbstractBindingImpl)provider.getBinding();
List<Handler> handlerChain = abi.getHandlerChain();
assertTrue(handlerChain.size() > 0);
List<SOAPMessage> outboundMessages = null;
List<LogicalMessageContext> inboundContexts = null;
boolean found = false;
for (Handler h : handlerChain) {
if (!found && h instanceof SOAPMessageRecorder) {
SOAPMessageRecorder recorder = (SOAPMessageRecorder)h;
outboundMessages = recorder.getOutboundMessages();
outboundMessages.clear();
found = true;
break;
}
}
assertTrue("Could not find SOAPMessageRecorder in post protocol handler chain", found);
handlerChain = abi.getPreLogicalSystemHandlers();
assertTrue(handlerChain.size() > 0);
found = false;
for (Handler h : handlerChain) {
if (!found && h instanceof LogicalMessageContextRecorder) {
LogicalMessageContextRecorder recorder = (LogicalMessageContextRecorder)h;