axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davanum Srinivas (JIRA)" <>
Subject [jira] Resolved: (AXIS-986) Can't share sessions between different services ??
Date Wed, 20 Apr 2005 22:46:28 GMT
     [ ]
Davanum Srinivas resolved AXIS-986:

     Assign To:     (was: Axis Developers Mailing List)
    Resolution: Won't Fix

See on how to do can call _setProperty
on the stub with the old cookie.

> Can't share sessions between different services ??
> --------------------------------------------------
>          Key: AXIS-986
>          URL:
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.1rc2
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Tristan B.
>  Attachments: sessionPatch.jar
> Hi everybody,
> I've been trying lately to share a session between two distinct axis web 
> services. I am using client generated classes (with WSDL2Java) and the default 
> hhtp cookie based session management.
> Here is how I proceeded :
> 1) I invoke the first XXX service :
> XXXService firstService = new XXXServiceLocator();
> XXX firstServiceRet = firstService.getXXX(new;
> ((XXXSoapBindingStub)firstServiceRet).setMaintainSession(true);
> firstServiceRet.XXX(...) //invoke the service
> Note the use of the setMaintainSession method : this sets the Stub and the 
> MessageContext maintainSession property to true.
> When getting back the response from the axis server, if this property is set to 
> true, axis retrieves the cookie header from the response and stores it in the 
> MessageContext :
> msgContext.setProperty(HTTPConstants.HEADER_COOKIE, cookie);
> (see org.apache.axis.transport.http.HTTPSender for details ...)
> 2) Then here is how I retrieve the cookie after the call to the XXX Service :
> Call XXXCall = ((org.apache.axis.client.axis.Service)firstService).getCall();
> org.apache.axis.MessageContext msgContext = XXXCall.getMessageContext();
> String cookie = msgContext.getStrProp(HTTPConstants.HEADER_COOKIE);
> This works fine ... checked it with TCPMon ... get the real cookie ...
> 3) I invoke the second YYY service:
> YYYService secondService = new YYYServiceLocator();
> YYY secondServiceRet = secondService.getYYY(new;
> ((YYYSoapBindingStub)firstServiceRet).setMaintainSession(true);
> Here again, if maintainSession is set to true, the writeToSocket method will 
> retrieve the cookie from the messageContext (String cookie = 
> msgContext.getStrProp(HTTPConstants.HEADER_COOKIE)) and put it into the http 
> header request.
> My idea here was thus to put the cookie retrieved from the first XXXCall into 
> the messageContext of the second YYY Call object before invoking it.
> The problem is that when invoking the call: YYYCall.invoke(...) (this is done 
> in the YYYSoapBindingStub class), the invoke metod calls the reset method of 
> the messageContext and the cookie information is lost !! (MessageContext.bag is 
> cleared) (see org.apache.axis.client.Call).
> Is there a way of passing the cookie to the second Call without modifying axis 
> code ??
> If not, it wouldn't require much code modifications to allow setting a cookie 
> in a call and thus allow Session Sharing.
> I think session sharing between different services is an important feature. 
> This is an important issue !!! 
> Any help would be greatly appreciated !!! Thanks ...
> PS: by the way, this method of passing the cookie from service to service works 
> perfectly with a .NET client !

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message