Mark, 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 TestSimpleSession.java, the setMaintainSession() method call is for the client. If you check out Stan Jordan's StatefulService example from this post: http://marc.theaimsgroup.com/?l=axis-user&m=101941819811033&w=2, 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.
Andrew 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 (TestSimpleSession.java, 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. > >Thanks. > >-Mark
