cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Stateful web services with CXF
Date Fri, 15 Oct 2010 19:10:24 GMT
On Friday 15 October 2010 8:24:58 am Benson Margulies wrote:
> Dan,
> 
> I'm a bit puzzled here.
> 
> The SessionFactory gets the session from the Exchange. 

Right.

 
> For an endpoint deployed by API, the only call I can find that
> establishes the session is in
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(Ser
> vletContext, HttpServletRequest, HttpServletResponse). That makes a new
> session every time.

It makes a new HTTPSession which wrappers the HttpServletRequest.   It doesn't 
actually call into the HttpServletRequest.getSession call until you actually 
try to query something out of it. 
org.apache.cxf.transport.http.HTTPSession

> If I needed some concept of sessions persisting across multiple calls,
> what would I do?

Well, you can get the HTTPServletRequest from the context (there is a standard 
JAX-WS property for that) and use the session directly.  You can grab the 
current message from PhaseInterceptorChain.getCurrentMessage and grab the 
exchange and the session from that.   Etc.....

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message