1 Reply Latest reply on Feb 22, 2013 1:57 PM by 945123

    JAX-WS handler not running

      I have a very simple web service. I would like to use a handler with the web service.
      I followed the directions here:

      I am using the HandlerChain annotation in the jws file:

      These are the contents of the security-context-handler.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">

      Here is the handler:
      package xxx.xxx..soaphandlers;

      import java.util.Set;
      import java.util.Collections;
      import javax.xml.namespace.QName;
      import javax.xml.ws.handler.soap.SOAPHandler;
      import javax.xml.ws.handler.MessageContext;
      import javax.xml.ws.handler.soap.SOAPMessageContext;
      import javax.xml.soap.SOAPMessage;

      public class SecurityContextHandler implements SOAPHandler<SOAPMessageContext>
      public Set<QName> getHeaders()
      { System.out.println("getHeaders()\n");
      return Collections.emptySet();
      public boolean handleMessage(SOAPMessageContext messageContext)
      {  System.out.println("handleMessage()\n");
      return true;

      public boolean handleFault(SOAPMessageContext messageContext)
      { System.out.println("handleFault()\n");
      return true;

      public void close(MessageContext messageContext)
      { System.out.println("Close()\n");

      I can see the compiled handler class in the WAR file. When the web service is invoked it completes without error, but the handler never runs (it only has a System.out.println()).

      I tried turning off the "Work Context Propagation Enabled" flag in the domain where the web service application is deployed, but that did not work.

      What could I have done wrong? How may I enable a JAX-WS web service handler in weblogic?
      Any pointers or advice are greatly appreciated.

      Thank you.

      Edited by: 942120 on Feb 15, 2013 8:24 AM