[jboss-user] [JBossWS] - SOAP Interceptor

zeeshan.javeed do-not-reply at jboss.com
Wed Jan 9 03:26:31 EST 2008


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118157#4118157

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118157



More information about the jboss-user mailing list