4 Replies Latest reply on Feb 14, 2008 8:48 AM by Magesh Bojan

    handler problem

    khaled Newbie

      Hi guys, I need to intercept the soap message at rhe server side,but it did not work. what i did is:
      1) i have this class:

      package org.jboss.ws.core.jaxws.handler;

      import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
      import javax.xml.ws.handler.MessageContext;
      public class HibernateWS extends GenericSOAPHandler
      public boolean handleFault(MessageContext msgContext)
      System.out.println("Inside GenericSOAPHandler : ");
      return super.handleFault(msgContext);
      protected boolean handleInbound(MessageContext msgContext)
      System.out.println("Inside GenericSOAPHandler : ");
      return true;
      protected boolean handleOutbound(MessageContext msgContext)
      System.out.println("Inside GenericSOAPHandler : ");
      return true;

      and i have put the compiled file(.class) in package org.jboss.ws.core.jaxws.handler, ( i use jbossws 1.2.0 ).

      2) I added the following to standard-jaxws-endpoint-config.xml file which is in jboss-4.0.5.GA\server\default\deploy\jbossws.sar\META-INF;
      <config-name>Handler hibernate gnomo</config-name>

      When i deployed my service it works as normal, but the handler doesn't print the messages as it is showen in the attached class (HibernateWS).

      can any body tell me what was wrong in this please.

      thanks in advance,

        • 1. Re: handler problem
          khaled Newbie

          this the simple source code i used in my web service:
          @RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
          @SOAPBinding(style = SOAPBinding.Style.RPC)
          public class EJB3Bean01 implements EJB3RemoteInterface
          public String echo(String input)
          return input;
          public interface EJB3RemoteInterface
          String echo(String input);

          and then i packaged them in jar file
          and deployed.

          can any body tell me what is wrong and why my handler doesnot print anything, please.
          any seggestion is appreciated

          • 2. Re: handler problem
            Heiko Braun Master

            The first thing is not to put your handler in jbossws packages. Keep them private to your application, that is a custom package.
            In order to deploy it with your actual endpoint you need to specify a @HandlerChain that points to your handler declaration.
            Did you read the userguide?

            • 3. Re: handler problem
              khaled Newbie

              i am aware of this way (@HandlerChain ), but what i am trying to do is:
              Intecept soap message without the need to modify or add any code to the client or the endpoint code.
              I need something that helps me to intercept any soap message comes in or out of the jboss server.
              So, is there a way of doing this, please

              • 4. Re: handler problem
                Magesh Bojan Master

                Yes you can. You can modify the standard templates available here


                See http://labs.jboss.com/jbossws/user-guide/en/html/1.0.4/en/html/endpoints.html section "4.4. Endpoint configuration templates"