axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Vardeman <>
Subject Re: Axis sessions using non-Axis client?
Date Tue, 14 May 2002 18:17:21 GMT

I think the code you're looking at contains a client and a server.  From 
skimming the comments, it looks like it's creating and deploying a service, 
then testing it with a client, all in the same program.  So, in, the setMaintainSession() method call is for the 
client.  If you check out Stan Jordan's StatefulService example from this 
post:, you 
can see that this method call is made in the client and not the 
service.  You can put a SimpleSessionHandler in front of your service (you 
specify this in the deploy.wsdd file).  This will generate a session id, 
place it in the SOAP Header or a cookie, create a corresponding Session 
object, and place a reference to it in the MessageContext so you can get at 
it from your service.  Store session data there and it's there the next 
time the client makes a request, provided the client includes the correct 
session ID in the SOAP Header or a cookie.  It's still up to the client to 
properly handle the session id on its end.


p.s. people who explained this to me, please jump in if I got it wrong--

>I know that Axis can maintain sessions based on either cookies, or using
>SOAP headers.  However, it appears that the Axis client class
>org.apache.axis.client.Service MUST be used to enable sessions.  Is there a
>way of supporting sessions with either cookies or SOAP headers that
>does not require using any Axis specific client classes?  Can anyone point
>me in the direction of any examples that show how to do this?
>I did see the session example (, included in the test
>directory of the Axis source release) which uses the SOAP header method,
>but it still uses the org.apache.axis.client.Service.setMaintainSession()
>function, so I'm not sure this will do what I expect.

View raw message