JAX-WS - . , cookie , . JAX-WS cookie, . , JAX-WS cookie , .
, cookie HTTP- -. ; .
:
- JAX-WS (, ), javax.xml.ws.session.maintain.
- .
JAX-WS , Common Annotations Java (JSR 250), - .
WebServiceContext , .
javax.xml.rpc.server.ServiceLifecycle. JAX-WS Web Service , , @Resource. java.lang.Object, javax.xml.ws.WebServiceContext.
@WebService
public class HelloWorld {
@Resource
private WebServiceContext wsContext;
public void sayHello(){
MessageContext mc = wsContext.getMessageContext();
HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
}
}