On Thursday 14 October 2010 5:01:38 pm thegreatone wrote: > I was reading how to do stateful web services using Metro: > > https://metro.dev.java.net/1.4/docs/statefulWebservice.html > > It uses the @Stateful annotation and returns and endpoint to the user that > maintains the state. > > I don't see how this can be done with CXF, or at least it's not documented > well. > > In the application I'm writing the server portion will be CXF (running in > JBoss). > > The clients can be anything but the big one is .net (C# / VB). > > If the stateful WS solution doesn't work with .net clients, it's useless to > me. None of the WS clients will be written with CXF.
There are two options: 1) Use the spring scopes and aop-proxy - this is generally what I recommend for normal scoping things such as per-request and session scopes as Spring has them built in. <bean class="my.ServiceImpl" id="myBean" scope="session"> <aop:scoped-proxy/> </bean> <jaxws:endpoint implementor="#myBean".../> 2) The cxf jaxws:endpoint/server config things have an invoker config element that can be used to specify a custom invoker. You can either subclass the JAXWSMethodInvoker that we use or provide a custom Factory to it's constructor. You could use our SessiontFactory: http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/ Dan -- Daniel Kulp [email protected] http://dankulp.com/blog
