You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Dennis Kieselhorst <ma...@dekies.de> on 2009/09/22 13:03:18 UTC
org.apache.cxf.message.MAINTAIN_SESSION vs. javax.xml.ws.BindingProvider.SESSION_MAINTAIN_PROPERTY
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_SESSI
ON, Boolean.TRUE);
the cookie headers are successfully preserved along all requests.
Why do I need the CXF-specific constant?
Regards
Dennis
Re: org.apache.cxf.message.MAINTAIN_SESSION vs. javax.xml.ws.BindingProvider.SESSION_MAINTAIN_PROPERTY
Posted by Daniel Kulp <dk...@apache.org>.
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
dkulp@apache.org
http://www.dankulp.com/blog