-
1. Re: Variable injection issue with web service
srini.ragu Mar 26, 2008 8:37 PM (in response to newbie000)Since webservice calls are stateless, your login wont persist across separate webservice request.
You should either implement a custom JAX-WS handler which does the login for you every time.
Or to get the stateful service, send the cid parameter from the webservice client when you make subsequent request after login call.
Seam sends you the cid parameter in the SOAP header after the first login, then by sending back the cid parameter in the header you should be able to join the same session. So you will have the identity information.
-
2. Re: Variable injection issue with web service
newbie000 Mar 27, 2008 12:01 AM (in response to newbie000)Ok cool that makes sense.
How exactly would I join the same session from the CID, and would i rejoin this session within the web service method?
Thanks
-
3. Re: Variable injection issue with web service
srini.ragu Mar 27, 2008 12:39 AM (in response to newbie000)if you sent the cid in the soap header as described in the doc, seam will pick that up and join you to the same conversation if a conversation with same cid exists.
http://docs.jboss.com/seam/2.1.0.A1/reference/en/html/webservices.html#d0e13315
Its like using conversation-id as key for state management.
If you are using a JAX-WS based client, you may need to write additional custom handlers to the add cid information to the soap header. And configure them to be apply on outgoing and incoming messages.
If you are constructing the whole request message manually then its easy to insert the cid to the SOAP header.
-
4. Re: Variable injection issue with web service
newbie000 Mar 27, 2008 3:39 AM (in response to newbie000)So are you saying that the action class must be conversational for it to work (i.e. @Scope(CONVERSATION))?
-
5. Re: Variable injection issue with web service
srini.ragu Mar 27, 2008 6:20 PM (in response to newbie000)To implement a stateful webservice requires a extra coding in webservice client normally in any framework. Easiest is to use them as stateless services.
If all you need is authorization and restrictions to access the webservice. Then you should perform authorization at container level, or by custom SOAP handler code.
Or inject the webservice context through @WebServiceContext annotation, so you can access request and response objects within your webservice.
There are several ways to implement security in webservices.