1 Reply Latest reply on Jul 23, 2012 1:52 PM by michael.vengerovich

    How to register JSR109 handler in JBoss 5.1 for SOA?

    michael.vengerovich

      Hi everyone.

      I have JSR109 compat. handler (named jsr109test.ServerHandler and implemented javax.xml.rpc.handler.Handler inteface). What is required to edit in JBoss 5.1 (for SOA) configuration to start it working (catch SOAP events)?

      [code]

      package jsr109test;
      import javax.xml.namespace.QName;
      import javax.xml.rpc.handler.Handler;
      import javax.xml.rpc.handler.HandlerInfo;
      import javax.xml.rpc.handler.MessageContext;
      public class ServerHandler implements Handler
      {
          private Logger log = new Logger();
          private HandlerInfo hi;
         /**
          * Initialize the JAX-RPC handler. According to JSR109, this method must
          * retain the information defined by the HandlerInfo.
          *
          * @param hi
          *            the HandlerInfo provided by the container.
          * @throws IllegalStateException
          *            if the container declared by this handler class is not
          *            supported by the agent.
          */
          @Override
          public void init(HandlerInfo hi)  {
              this.hi = hi;
              log.Info("Handler created", hi);
          }
          @Override
          public void destroy() {
              log.Info("Handler destoyed", hi);
          }
          @Override
          public QName[] getHeaders() {
              QName[] res = hi.getHeaders();
              log.Info("Handler getHeaders() = ", res);
              return res;
          }
          @Override
          public boolean handleFault(MessageContext mc) {
              log.Info("Handler handleFault(mc), mc = ", mc);
              return true;
          }
          @Override
          public boolean handleRequest(MessageContext mc) {
              log.Info("Handler handleRequest(mc), mc = ", mc);
              return true;
          }
          @Override
          public boolean handleResponse(MessageContext mc) {
              log.Info("Handler handleResponse(mc), mc = ", mc);
              return true;
          }
      }

      [/code]

        • 1. Re: How to register JSR109 handler in JBoss 5.1 for SOA?
          michael.vengerovich

          Also another handler:

          package jsr109test;
          import javax.xml.ws.handler.Handler;
          import javax.xml.ws.handler.MessageContext;
          public class SOAPHandler implements Handler<MessageContext> {
              private Logger log = new Logger(this.getClass().getName());
              @Override
              public boolean handleMessage(MessageContext mc) {
                  log.Info("handleMessage(MessageContext mc), mc = ", mc);
                  return true;
              }
              @Override
              public boolean handleFault(MessageContext mc) {
                  log.Info("handleFault(MessageContext mc), mc = ", mc);
                  return true;
              }
              @Override
              public void close(MessageContext mc) {
                  log.Info("close(MessageContext mc), mc = ", mc);
              }
          }

          May be somebody knows how to turn it on...