ianroberts wrote:
> 
> 
> You should be able to define a request-scoped Spring bean to hold the data
> you want to pass around and inject that into your service object,
> interceptors, etc.  You can call the methods of this bean and Spring will
> magically take care of directing the calls to the right place for the
> request.  I do something very similar to support a stateful web service
> where I need to maintain state across an HTTPSession.  In fact I go one
> further and actually use a session-scoped bean as my SEI:
> 
> <bean id="myServiceImpl" class="my.package.WebServiceImpl"
> scope="session">
>   <aop:scoped-proxy />
> </bean>
> 
> <jaxws:server id="serviceEndpoint" serviceBean="#myServiceImpl"
>     serviceClass="my.package.WebServiceImpl" address="/myService" />
> 
> And tell the client to maintain the session
> (http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html).
>  
> Works beautifully :-)
> 
> Ian
> 

Thanks, Ian! After struggling with this approach for three weeks on and off,
I can now confirm that it does work beautifully!

It turns out that my earlier problems were due to subtle version mismatches
among Spring components. What worked for me is to use the latest available
version of spring-aop (2.0.8) and match the other components to that
version. In addition, cglib 2.1_3 and asm 1.5.3 have to be in the classpath. 

In case anyone is interested, I have a complete, Maven-ized toy example I
put together for my web services class (this stuff needs to be as foolproof
as possible for this purpose):

cvs -d :pserver:[EMAIL PROTECTED]:/root/laufer/433 co
NumguessServiceStatefulCXF
cd NumguessServiceStatefulCXF
mvn jetty:run

Any feedback will be appreciated, too.

Thanks again,

Konstantin
-- 
View this message in context: 
http://www.nabble.com/Share-object-in-request-scope-on-ws-server-tp14611572p16048592.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to