You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ulrike <ul...@liwest.at> on 2008/04/17 10:17:26 UTC

How to develop a WebServiceClient correctly?

Currently I’m using CXF for accessing some Seam (stateful) services. I
managed it to maintain session state of one service (I’ve set the
SESSION_MAINTAIN_PROPERTY to true), but I need some further help with
different services using the same session.
A usual scenario would be following:

•	a registered user logs in (name, pwd) – AuthenticationService
•	invokes some methods of Service A
•	same with other methods of Service B
•	…
•	user logs out - AuthenticationService

How can different services share the same session till timeout?
-- 
View this message in context: http://www.nabble.com/How-to-develop-a-WebServiceClient-correctly--tp16741038p16741038.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to develop a WebServiceClient correctly?

Posted by Ulrike <ul...@liwest.at>.
There was just one missing line that separated me from enlightenment. ;)

requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, requestHeaders);

I forgot to put the requestHeaders back into the requestContext... Maybe I
need a little break.

Thank you for help!
-- 
View this message in context: http://www.nabble.com/How-to-develop-a-WebServiceClient-correctly--tp16741038p16804879.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to develop a WebServiceClient correctly?

Posted by Daniel Kulp <dk...@apache.org>.

This is not easy to do.   The client instances are specifically designed 
to be somewhat independent.   You are PROBABLY going to have to do some 
Cookie management yourself.   Basically, from the AuthenticationService 
client, get the ResponseContext from it and get the protocol headers 
from it and find the Set-Cookie protocol header.   On the other clients, 
you'll need to get the ReqeustContext and get (possibly create) the 
protocol headers map and add the approriate cookie.  

Dan



On Thursday 17 April 2008, Ulrike wrote:
> Currently I’m using CXF for accessing some Seam (stateful) services. I
> managed it to maintain session state of one service (I’ve set the
> SESSION_MAINTAIN_PROPERTY to true), but I need some further help with
> different services using the same session.
> A usual scenario would be following:
>
> •	a registered user logs in (name, pwd) – AuthenticationService
> •	invokes some methods of Service A
> •	same with other methods of Service B
> •	…
> •	user logs out - AuthenticationService
>
> How can different services share the same session till timeout?



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog