On Tue September 22 2009 7:03:18 am Dennis Kieselhorst wrote:
> Hi,
> 
> I tried to maintain a session with the dynamic client:
>   JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
>   Client client = dcf.createClient(wsdlUri);
> 
> client.getRequestContext().put(javax.xml.ws.BindingProvider.BindingProvider
> . SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
> 
> This doesn't work. Replacing it with
> 
> client.getRequestContext().put(org.apache.cxf.message.Message.MAINTAIN_SESS
> I ON, Boolean.TRUE);
> the cookie headers are successfully preserved along all requests.
> 
> Why do I need the CXF-specific constant?

When working with the "Client" object, you are completely dealing with the CXF 
internal stuff which is completely independent of jaxws.   Thus, you need to 
use the CXF properties.

When creating a proxy object using the normal JAX-WS calls, the Client is 
wrappered with a JaxWsClientProxy which wrappers the contexts with wrappers 
that map the JAX-WS properties to the CXF properties.   

It might be possible to have the JaxWsDynamicClientFactory return a special 
subclass of ClientImpl that does the same thing.   The call to "new 
ClientImpl(...)" in the parent could be replaced with a call to a protected 
method that the JaxWsDynamicClientFactory overrides to return the subclass.   
If you want, log a JIRA (and a patch would be nice ;-).

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to