Is there a way to instantiate a WebClient instance programmatically such
that it is bound to a Spring-configured CXF instance?  Ideally one should be
able to pass in either a Bus or ApplicationContext instance.
JAXRSClientFactoryBean does have a setBus() method, but setting the
spring-instantiated bus instance doesn't seem to do the trick.

The problem is that the manually instantiated WebClient instances don't pick
up HTTPConduit configuration from spring.  In fact, it seems to create a new
HTTPConduit for each WebClient instance, which I found to be surprising.  As
it stands, the only way I seem to be able to get a "fully configured"
wired-to-spring-instantiated-cxf WebClient is to call WebClient.fromClient()
on the spring-managed Client instance for a given <jaxrs:client>.

It works, but seems needlessly clunky.  Surely there is a better way...

Cheers,

Rob

Reply via email to