3 Replies Latest reply on Jun 24, 2015 9:15 AM by satin satin

    SOAP Interceptor

    Zeeshan Javeed Newbie

      Hi All,
      I am trying to intercept soap request. I have followed the instruction of @handler annotation but request never pass throught the Handler class. Anybody, having any idea...

      here is the code.

      in the start of the implementation class:

      @WebService(name = "webservice")
      @HandlerChain (name = "SoapHandler" , file = "WEB-INF/handler.xml")


      handler.xml class is
       <?xml version="1.0" encoding="UTF-8"?>
      
      <handler-config>
       <handler-chain>
       <handler-chain-name>SoapHandler</handler-chain-name>
       <handler>
       <handler-name>testSOAPHandler</handler-name> <handler-class>my.webservice.impl.SOAPHandler</handler-class>
       </handler>
       </handler-chain>
      </handler-config>
      
      



      and code for Soap handler class is :
      
      package my.webservice.impl;
      
      import javax.xml.namespace.QName;
      import org.jboss.ws.core.jaxws.handler.*;
      
      import javax.xml.rpc.handler.HandlerInfo;
      import javax.xml.rpc.handler.MessageContext;
      
      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      
      /**
       *
       * @version $Revision: 1 $
       */
      @Revision("$Revision: 1 $")
      public class SOAPHandler extends GenericHandler
      {
       /**
       * Logger
       */
       private static final Log log = LogFactory.getLog(WipeSOAPHandler.class);
      
       /** SOAP headers */
       protected QName[] headers;
      
      
      
       /**
       * @see javax.xml.rpc.handler.GenericHandler#init(javax.xml.rpc.handler.HandlerInfo)
       */
       public void init(HandlerInfo info)
       {
       log.info("init: " + info);
       System.out.println("Init section");
       this.headers = info.getHeaders();
       }
      
      
       /**
       * @return
       * @see javax.xml.rpc.handler.GenericHandler#getHeaders()
       */
       public QName[] getHeaders()
       {
       return this.headers;
       }
      
       /**
       * @return
       * @see javax.xml.rpc.handler.GenericHandler#handleRequest(javax.xml.rpc.handler.MessageContext)
       */
       public boolean handleRequest(MessageContext context)
       {
       log.debug("+++> handleRequest");
      
       return true;
       }
      
       /**
       * @param context
       * @return
       * @see javax.xml.rpc.handler.GenericHandler#handleResponse(javax.xml.rpc.handler.MessageContext)
       *
       *
       *
       */
       public boolean handleResponse(MessageContext context)
       {
       log.debug("+++> handle SOAP response:");
      
      
       return true;
       }
      
      
      }
      
      
      




      .....
      I am not getting any help... plz help out...

      Regards,
      Zeeshan