cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: Dynamic WSDL location by CXF Consumer
Date Wed, 01 Feb 2012 17:16:00 GMT
Just posting the Dan's answer:

> Hi,
> 
> Just would like to check the following thing in CXF architecture:
> As I understand WSDL  is initialized quite early on the Client side. 
> If wsdlLocation attribute is defined in client spring configuration, 
> JaxWsProxyFactoryBean -> ClientFactoryBean -> 
> ReflectionServiceFactoryBean get WSDL from the location and build 
> Service Model. At this point service endpoint and policy attachments 
> are loaded. When client proxy is injected, it has already pre-initialized endpoint and
policies from WSDL.

All correct.


> 
> Question: is there any possibility to update WSDL dynamically (for 
> example load from another location with updated endpoint and policies) 
> after client proxy is injected?

Not at this time, no.    It's actually even worse than you think.    In some 
cases, even discarding the client and creating a new one wouldn't even work.   
The WSDLManager in CXF caches the WSDL's so creating a new client proxy might not even cause
a new WSDL to be downloaded.


> Use case: service is looked up dynamically via service
> registry and client should make some decisions which service wsdl will be
> used in callbacks handler. Therefore possible solution will be just to tell
> client after ServiceRegistry lookup and callback calls - this is new WSDL
> url with updated endpoint and updated policies. As far as I can see it is
> not possible in CXF now, but just ask it to be sure.

Well, an interceptor at the very beginning of the chain CAN manipulate a few 
things.   Things like the address can likely be modified.   Policies could be 
replaced/removed, etc...   Nothing really built into CXF, but it is something 
that is doable.  
 
> Alternative solution is update only endpoint in ConduitSelector (like
> ServiceLocator is doing) and set policies dynamically using POLICY_OVERLOAD
> property. WSDL solution is more standard and elegant, but seems to be not
> possible now in CXF.

I'd really need to think about this more.   Even from the ConduitSelector, I 
think you could completely replace the policies in the Service model if you 
wanted to go that route instead of the POLICY_OVERLOAD method.   


-- 
Daniel Kulp

-----Original Message-----
From: Andrei Shakirin [mailto:ashakirin@talend.com] 
Sent: 01 February 2012 16:10
To: dev@cxf.apache.org
Subject: Dynamic WSDL location by CXF Consumer

Hi,

Just would like to check the following thing in CXF architecture:
As I understand WSDL  is initialized quite early on the Client side. If wsdlLocation attribute
is defined in client spring configuration, JaxWsProxyFactoryBean -> ClientFactoryBean ->
ReflectionServiceFactoryBean get WSDL from the location and build Service Model. At this point
service endpoint and policy attachments are loaded. When client proxy is injected, it has
already pre-initialized endpoint and policies from WSDL.

Question: is there any possibility to update WSDL dynamically (for example load from another
location with updated endpoint and policies) after client proxy is injected?
Use case: service is looked up dynamically via service registry and client should make some
decisions which service wsdl will be used in callbacks handler. Therefore possible solution
will be just to tell client after ServiceRegistry lookup and callback calls - this is new
WSDL url with updated endpoint and updated policies.
As far as I can see it is not possible in CXF now, but just ask it to be sure.

Alternative solution is update only endpoint in ConduitSelector and set policies dynamically
using POLICY_OVERLOAD property.
WSDL solution seems to be more elegant, but I am not sure is it possible now in CXF.

Regards,
Andrei.


Mime
View raw message