axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tony.q.wed...@gsk.com
Subject Re: How to get/set cookies from the Axis *client* side?
Date Wed, 01 Dec 2004 17:01:04 GMT
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
> 
> 

Mime
View raw message