Sunday, April 10, 2011

JAX-WS with JBoss 6 Day 10 : Stateful

A service using a SOAP/HTTP binding can use the following three mechanisms for maintaining a session:
• Cookies
• URL Rewriting
• SSL Sessions

The WS-I Basic Profile says the following about stateful web services:
• BP allows a service to use HTTP cookies to maintain sessions.
• BP discourages a service to rely on the use of cookies for maintaining a state.

As far as I know @Stateful is not supported by Apache CXF , so we have to use HttpSession

1. stateless web service


2. generate jaxws client and write a test case as Day 1 example , the return value of num will always be 1

3. stateful web service


4. test case for stateful web service


5. HTTP console info :
Headers: {SOAPAction=[""], Cookie=[$Version="1"; JSESSIONID=7DE484ACCE11F6B58EA1DC744F9333A2; $Path=/iJBossWS], Accept=[*/*]}

No comments: