axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Kühnel" <Stefan.Kueh...@gmx.net>
Subject Handling sessions across two web services
Date Mon, 18 Aug 2008 18:08:01 GMT
Hello *,

we're getting the error "Error: Maintain Session is enabled but none of the 
session properties (Cookies, Over-written URL) are returned." when we're 
trying to use the same HTTP session over two different web service client 
proxies. Both proxies point to web services on the same webserver under 
different paths (a la http://example.org/service1 and 
http://example.org/service2). The Set-Cookie2 from the first service has a 
path of "/", so the cookie is valid for the second web service as well.

The problem is that even though we copy the cookie from the first proxy to 
the second proxy via the requestContext, Axis thinks there is no valid 
session in the second proxy since the second web service returns no cookie 
via Set-Cookie.

The problem is, if I analyze this correctly, that the second proxy uses its 
own ServiceContext, that is not shared with the ServiceContext of the first 
proxy. The value we store in the requestContext is only used in the 
request, but not copied into the ServiceContext. Therefore on return of the 
call from the server, when Axis tries to set up the requestContext for the 
next call, this exception is raised, because it doesn't find the cookie in 
the ServiceContext. This set-up of the next  request happens in 
org.apache.axis2.jaxws.BindingProvider.setupSessionContext(), where the 
exception is raised.

The question now is, do you know of a workaround? Preferably one using only 
JAX-WS features, so that we're not getting an explicit dependency on Axis.

In abstract terms, we would need the ability to
* create the first proxy
 * make the first call
 * extract the session state (aka "sessionValue" in terms of the method 
setupSessionContext) from the proxy
* persist the session state

When making the call to the second web service, we want to
* load the session state from our persistent store
* create the second proxy
* set the session state for this proxy
* make the second call

Thanks,
Stefan
    
-- 
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

Mime
View raw message