cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Noordermeer (JIRA)" <>
Subject [jira] [Commented] (CXF-4747) Support easier configuration of Spring bus with WebClient
Date Thu, 18 Apr 2013 11:31:16 GMT


Mike Noordermeer commented on CXF-4747:

FYI, the following should actually work, note the factory name:

This works, but does not set the bus. I have no idea how I can reference the default bus created
by CXF. I can create one myself, but that one will use a new Spring context, and not the existing
application context, and will therefore not pick up http conduits defined in the current Spring

Also note that if you create WebClient from the code and it is initialized with a reference
to the existing Spring configuration, then a matching HttpConduit loaded from that configuration
will be activated.

You cannot refer the existing Spring context when creating a WebClient from code. You can
only point it to a new configfile and then it will create a new Bus from that configfile (hence
you end up with multiple CXF busses if other parts of your application also use CXF).

{quote}Also, from the code, you can explicitly create a Spring bus and then set it on JAXRSClientFactoryBean
and call createWebClient on it...
Maybe, but I have no idea how to refer to the globally created default CXF bus.

What I would like is to be able to use a WebClient just like I can use a jaxrs:client, including
the http conduit. So I would like to have 1 Spring config file, with my client definition
as well as my http conduit. IIRC it seemed like that was impossible (but it's a couple of
months ago I looked into this, and I may have missed something, so please correct me if I'm
> Support easier configuration of Spring bus with WebClient
> ---------------------------------------------------------
>                 Key: CXF-4747
>                 URL:
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.7.1
>            Reporter: Mike Noordermeer
>            Priority: Minor
> The current {{WebClient.create()}} methods only support either using a fresh bus, or
creating a new bus from a Spring config file. It should be possible to reuse an existing Spring
bus, so you can for instance enter your {{<http:conduit>}} elements in your usual Spring
> The same issue was asked before on the [mailing list|],
but without an answer.
> I have found a workaround, but I don't find it too pretty:
> {code:xml}
>     <http:conduit name="*.http-conduit">
>         <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000" />
>         <http:tlsClientParameters>
>             <sec:keyManagers keyPassword="pass">
>                 <sec:keyStore resource="mykeystore.jks" password="pass" type="JKS"
>             </sec:keyManagers>
>         </http:tlsClientParameters>
>     </http:conduit>
>     <bean id="myWebClientFactory" class="org.apache.cxf.jaxrs.spring.JAXRSClientFactoryBeanDefinitionParser.JAXRSSpringClientFactoryBean">
>         <property name="address" value="${myurl}" />
>         <property name="providers">
>             <list>
>                 <bean class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider" />
>             </list>
>         </property>
>     </bean>
>     <bean id="myWebClient" factory-bean="myWebClientFactory" factory-method="createWebClient"
> {code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message