JBoss Community

How to share session between web service calls?

reply from Jim Ma in JBoss Web Services CXF - View the full discussion
The headers set in the first BindingProvider may not be same as the  headers in the second binding provider because CXF would create a  different cookie for the second BindingProvider instance.

Yes. The second headers will be different from the first one .  You need to get the headers form RequestContext again .

 

So  is the solution to keep the header, cookie information in a local data  structure in the client side and keep copying it back to all new  BindingProvider instances created from client side so that the same  cookie information is relayed back to the server?

Please note this is just a sample and test code from CXF code base. It just demonstrate how

can you use the BindingProvider stuff to do this job .

 

But this way it would not be too different from the HttpConduit approach i had mentioned earlier.

Well , technically speaking they are same. You have to locally maintain the cookie.  But the big different is this uses jaxws standard api . Your code is portable and can run on jbossws native or  other soap stack .  And I also do not think simply change the configuraiton can do this job .

Are there any changes on the server that also needs to be done?

Your current server code can work with this approach.

Reply to this message by going to Community

Start a new discussion in JBoss Web Services CXF at Community