On Tue December 8 2009 9:31:27 am Alexandros Karypidis wrote: > Hi, > > I intend to use JAX-WS to access web services from within servlets in a > clustered environment. > > Rather than create a proxy for each servlet invocation, I'd like to > cache the client stub in the session object. > > Does CXF use serializable objects when creating JAX-WS proxies?
Probably not, no. Very little in CXF implements serializable so that may end up being an issue. Plus, the clients hold onto things like shared wsdl models and JAXBContexts and such that could be huge to serialized > Is it > safe to put a JAX-WS client stub in the servlet's "session" object? You MAY be able to use proxy singletons. See: http://cxf.apache.org/faq.html about the thread safety and such of the proxies. You could just store and special "keys" for the RequestContext into the session and just use a single client proxy with a threadsafe RequestContext. -- Daniel Kulp [email protected] http://www.dankulp.com/blog
