3 Replies Latest reply on Feb 14, 2005 2:51 PM by Thomas Diesler

    Configuring Handlers

    Marcelo Pitanga Newbie

      Hi all,

      In the RI ( Reference Implementation ) the file config.xml is used for this operation.

      How i configured this handler as part of a handler chain at Jboss?

      my handler is :

      public class SoapRpcInterceptor extends GenericHandler {
       HandlerInfo hInfo;
       String nomeHandle;
       public void init(HandlerInfo info) {
       hInfo = info;
       nomeHandle = (String)hInfo.getHandlerClass().getSimpleName();
       public QName[] getHeaders() {
       return hInfo.getHeaders();
       public boolean handleRequest(MessageContext msgCtx) {
       try {
       Date dtInicio = new Date();
       msgCtx.setProperty("dtInicio", dtInicio);
       System.out.println("Request (handler)->"+nomeHandle+" Inicio="+dtInicio);
       SOAPMessageContext smc = (SOAPMessageContext)msgCtx;
       SOAPMessage msg = smc.getMessage();
       catch (Exception e) {
       System.out.println("Error Request:"+e.getMessage());
       return true;
       * (non-Javadoc)
       * @see javax.xml.rpc.handler.Handler#handleResponse(javax.xml.rpc.handler.MessageContext)
       public boolean handleResponse(MessageContext msgCtx) {
       try {
       Date dtIni = (Date) msgCtx.getProperty("dtInicio");
       Date dtFinal = new Date();
       long duracao = dtFinal.getTime()-dtIni.getTime();
       catch (Exception e) {
       System.out.println("Error Response: "+e.getMessage());
       return true;
       /* (non-Javadoc)
       * @see javax.xml.rpc.handler.GenericHandler#handleFault(javax.xml.rpc.handler.MessageContext)
       public boolean handleFault(MessageContext arg0) {
       return true;

        • 1. Re: Configuring Handlers
          Thomas Diesler Master

          If its a server side handler in webservices.xml
          If its a client side handler in <service-ref> in ejb-jar.xml, web.xml, application-client.xml

          • 2. Re: Configuring Handlers
            Marcelo Pitanga Newbie

            Hi Thomas,

            Thank´s for reply.

            I do this configuration and the handler work´s fine.


            I'm creating this handler for logging the operations at the web services. Exists a way for get informations on the handler-name, port-component-name, webservice-description-name... of the webservice.xml ?

            • 3. Re: Configuring Handlers
              Thomas Diesler Master

              Not in a portable way (standard) way. In JBoss you can go to the jboss.ws4ee:service=AxisService and obain the PortComponentInfo for a given serviceID.

              Form that you should be able to navigate to the info you need.