Hello,
I wonder if anybody could help me with this?
I'm running a jax-ws webservice through glassfish, and I'm trying to get hold of the session using the following code:
MessageContext mc = context.getMessageContext();
HttpServletRequest r = (HttpServletRequest)mc.get(MessageContext.SERVLET_CONTEXT);
HttpSession s = r.getSession();
I got this code from the following tutorial:
https://jax-ws-commons.dev.java.net/http-session-scope/
However, mc.get(MessageContext.SERVLET_CONTEXT) does not seem to return an HttpServletRequest! Rather I get the following error message:
org.apache.catalina.core.ApplicationContextFacade cannot be cast to javax.servlet.http.HttpServletRequest
This seems strange to me. Why is glassfish returning an Apache object? Does anybody know what's going on here, and how I can get hold of the HttpSession object?
Thanks a lot in advance,
Chris