-
Feature Request
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
-
Wildfly 8.2.0.Final on RHEL 6.5
-
Compatibility/Configuration, User Experience
When a handler is attached the client of a JAX-WS service, only the outbound request is intercepted. The inbound reponse isn't. Furthermore, the reverse applies to any JAX-WS service handle when using the @HandlerChain annotation. An example of a client-side handlers usage is depicted below:
TestServlet.java
List<Handler> handlers=new ArrayList<Handler>(); handlers.add(new DemoHandler()); Service service = Service.create(new URL(http://example.com/demoWs?wsdl"), new QName(DemoWsInterface.TARGET_NAMESPACE, "DemoWs")); demoWs=service.getPort(DemoWsInterface.class); ((BindingProvider) demoyWs).getBinding().setHandlerChain(handlers);
And the handleMessage function in my handler is as such:
DemoHandler.java
public boolean handleMessage(SOAPMessageContext msgContext) { Boolean outbound = (Boolean) msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if(outbound) System.out.print("Outbound soap request"); else System.out.print("Inbound soap response"); return true; }
Everytime the client is used, the message "Outbound soap request" is displayed. However, the inbound message is never displayed when the response comes back. This should not be the case as the J2EE specification states a handler should receive the inbound and outbound soap messages on both the client and service.