Thanks Tony for your good replies on this list.

I wonder if my approach is good in general. I suspect there will also be non-Axis clients like .NET and maybe other frameworks on the client side that will need to do the same.

Does anyone have a different idea to achieve the same behavior? I think SOAP headers for session tracking should work and I suppose it is more portable, right? If I could get rid of the requirement to use cookie based tracking ...

I am open to other suggestions :)

Tim


[EMAIL PROTECTED] wrote:

In that case, as I mentioned in my first reply, extract the cookies from the message context, in the first reply and store them somewhere (for example, in a static variable or in system properties) that will be available in the next call. In that next call, add the cookies to the message context and they should get picked up by the Axis HTTPSender, if maintainSession is set to true. Provided the same host is called each time, this should work. Simple Axis handlers can be written to do this.


Tony

*Tim K. (Gmane)* wrote on 01/12/2004 16:45:06:

> John Walker wrote:
> >>Is it possible to get and set cookies on the HTTP transport from the
> >>*client* side of Axis?
> >
> >
> > I tried using the MessageContext to get the HttpRequest object, and
> > then set cookies there, but it seemed that when doing this from the
> > AXIS client side, when the HTTP message got to the receiver, my
> > cookies had been clobbered.
> >
> > I know this isnt an affirmation, but a warning about cookies and
> > inconsistency. I think it may be an easier thing to utilize the
> > standard AXIS APIs to transfer data about the client to the server.
> > For example, there is a way to set the username and password for
> > authentication.
> >
> > What data are you trying to hold onto that SOAP/AXIS doesnt handlenatively?
> >
>
> I have multiple module that I am thinking of deploying as individual web
> services running in the same web app rather than create a big interface
> and have one big monolithic service with 200+ methods in it. One of the
> modules is a SessionModule that the client needs to call to authenticate
> before using the other modules, so I need some sort of session tracking
> across the modules.
>
> I know I could use SOAP headers which would probably work OK across the
> modules, but I need to do the session tracking via cookies because
> there's another servlet in the same web app that needs to use the same
> session (complicated, I know).
>
> So I was thinking if it's possible to do something like this:
>
> 1. From the client call the SessionModule with the MAINTAIN_SESSION
> property or whatever it is which will establish a session (HttpSession)
> on the server and send a cookie back to the client which Axis will store.
>
> 2. From the client before calling another module, set the session cookie
> from #1 before making the call so that the same HttpSession as in #1 is
> recovered and used on the server side (this other module requires that
> the user is authenticated).
>
> 3. Continue doing #2 for all modules when they are needed.
>
> Maybe I'm complicating my life, is there an easier way to achieve this?
> Basically session tracking across a set of web services deployed in the
> same web app.
>
> Thanks for your help.
>
> Tim
>
>



Reply via email to