• Post Reply Bookmark Topic Watch Topic
  • New Topic

WebServices + stateful ?  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebServices are sateless. How to make WebServices statefull? How about Rampart(WS-Security implementation for Axis2) / XACML ?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
First of all a word of warning: Stateful services does not scale well.
With that said, there are the following options for making web service stateful:
If you are using SOAP with HTTP or RESTful web service over HTTP, then you can use:
• Cookies
• URL Rewriting
• SSL Sessions

Concerning SOAP web services, note that the WS-I Basic Profile allows the use of cookies to maintain session but discourages it.

A third alternative available for both SOAP and RESTful web services is to use a correlation identifier, which is enclosed with subsequent requests in a session.
Example:
- Client sends first request to the service and, as part of the response, receives a session identifier.
- Subsequent requests within the session include the session identifier as received above.
- The session identifier is made invalid either by the client explicitly terminating the session or by the session timing out.

A better alternative, if possible, is to include all the data, including state, in each request from the client. Maintaining the state data thus becomes the responsibility of the client and the service can now easily be scaled.
Best wishes!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stateful and Stateless Services speaks to it.

Regards,
Dan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dan, I wasn't aware of the WS-Context specification!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!