Hello

I need to be able to invoke a web service via my client with both http and 
https. From what I understood, it is possible to configure a conduit statically 
or dynamically.

Static configuration from 
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html
 cannot be used, because it configures conduit per port, and I don't know in 
advance if I need http or https. Since conduit configuration is independent of 
<jaxws:client.. /> configuration, it probably won't help to create 2 clients - 
one for http and another for https (this sounds very messy anyway).

When using dynamic conduit configuration, 
final Client client = ClientProxy.getClient(serviceClient);
final HTTPConduit httpConduit = (HTTPConduit)client.getConduit();

httpConduit is always the same object. serviceClient is instance of some client 
declared with <jaxws:client.. /> injected into my spring bean with scope 
prototype. Since I will be invoking web service in parallel (some via http, 
others via https), I cannot modify this httpConduit, as it would break the CXF 
client.

Do I need to implement some ConduitSelector and then based on protocol use http 
or https conduit? Creation of HTTPConduit doesn't look easy as it also requires 
Bus and EndpointInfo which I don't have access to.

I think configuration of http/https in Apache CXF is really inflexible, if 
somebody wants to use static clients with dynamic protocol.

Jaro

Reply via email to