You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/04/18 12:31:17 UTC

[jira] [Commented] (CXF-4747) Support easier configuration of Spring bus with WebClient

    [ https://issues.apache.org/jira/browse/CXF-4747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635069#comment-13635069 ] 

Sergey Beryozkin commented on CXF-4747:
---------------------------------------

Hi, 

FYI, the following should actually work, note the factory name:
{code:java}
<bean id="myWebClientFactory" class="org.apache.cxf.jaxrs.spring.JAXRSClientFactoryBean">
        <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}

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.

Also, from the code, you can explicitly create a Spring bus and then set it on JAXRSClientFactoryBean and call createWebClient on it...

Can you clarify a bit more please what exactly would you like to be done.

                
> Support easier configuration of Spring bus with WebClient
> ---------------------------------------------------------
>
>                 Key: CXF-4747
>                 URL: https://issues.apache.org/jira/browse/CXF-4747
>             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 config.
> The same issue was asked before on the [mailing list|http://mail-archives.apache.org/mod_mbox/cxf-users/201001.mbox/%3CD9D39D1E52C5514C94DE9B5E928C72DB032BC6E5@MAIL02.bedford.progress.com%3E], 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: http://www.atlassian.com/software/jira