Hi,

I don't think it can be done by adding the interceptor now , because CXF HttpConduit [1] just holds the cookies as it's member variable. And for each Client proxy, CXF will set up a different HttpConduit for the http connection. If you want to accomplish the task, you need do some extract work on HttpConduit. I will see if you can set the http header some place and let the HttpConduit consumer it later today.

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Willem.
John McLaughlin wrote:
Hi,

I've just started to look at CXF, and have successfully managed to quickly develop/deploy.

The scenario I have is that I will have multiple web services running in Tomcat, and I want to maintain a session across them. I'm defining the services using JAX-WS (newbie here too!)

I can set BindingProvider.SESSION_MAINTAIN_PROPERTY on the client side to true, and this works fine on an individual proxy with JSESSIONID sent received, and I can access the appropriate session on the server side. However, when I call a second service it results in another session being started.

I've been trawling through APIs and the mail archives all afternoon, but haven't come up with any answers. Is it possible to retrieve the JSESSIONID from the first service and stuff it into the second service? I'm guessing an Interceptor on the client would be the way to go, but I haven't been able to find any examples. Failing all that, would it be a valid approach to add an Interceptor which would add/extract a header on messages?

I'd prefer to go with the JSESSIONID as I can let Tomcat take care of the session management, so if anybody can point me in the right direction, I'd much appreciate it!

Thanks,

John

Reply via email to