6 Replies Latest reply on Nov 28, 2007 11:00 AM by davidkally

    redirect  SOAP message request

    davidkally

      Hi,
      I just have wender if there is any possibility of changing the direction of
      the SOAP message to go to a proxy service (i.e. synapse) instead of its destination, however i need to do this without involving the client Application.
      Some thoughts:
      1 - if i can change anything in the SOAP library?
      2 - if i can intercept MessageContext (when it goes through the SOAP stack) and change the destination Address. ?

      I really need this to do some evaluation in my research

      Thanks in advance to your help

      Regards
      khaled

        • 1. Re: redirect  SOAP message request
          ropalka

          Hi,

          you could implement your own client JAXWS handler (extending org.jboss.ws.core.jaxws.handler.GenericSOAPHandler). Put your
          handler on the beginning of the handler chain and set up addressing
          properties there:

          protected boolean handleOutbound(MessageContext msgContext)
           {
          
          CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
          SOAPAddressingProperties addrProps = (SOAPAddressingProperties)
          
          // construct new addressing properties
          commonMsgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrPropsPointingToProxy);
          
           }


          Richard

          • 2. Re: redirect  SOAP message request
            davidkally

            Hi Richard,

            Thanks for the reply.

            what you seggests is very helpful, but as i understood i need to change the Client Application in order to add myhandler class to the handler chain, is it right? if it is so, this does not satisfy my requirments which is i do not have to chane anything in the client Application...!
            is there anyother way of doing this... ??

            thanks for the help

            • 3. Re: redirect  SOAP message request
              ropalka

              Hi,

              yes, you're right, you would need to change the client configuration. I understood you can't change client code only, but anything else is good for you. Sorry for this misunderstanding.
              If you can't change client application at all then I have no suggestions for you ;-(

              Richard

              • 4. Re: redirect  SOAP message request
                davidkally

                Hi Richard again,

                I just need if you can give me please an Example of how i can

                // construct new addressing properties

                because i will try to intercept all the request go through the SOAP stack and add what you seggest to the messageContext before it go to the wire.
                ...!

                cheers

                • 5. Re: redirect  SOAP message request
                  ropalka

                  Hi,

                  it's pretty simple:

                  import org.jboss.ws.extensions.addressing.AddressingClientUtil;
                  ...
                  AddressingProperties addressingProps = AddressingClientUtil
                   .createAnonymousProps(addressingAction, endpointAddress);


                  Richard

                  • 6. Re: redirect  SOAP message request
                    davidkally

                    Thanks Richard, that is really helpful

                    Cheers