You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Karlsen <da...@gmail.com> on 2017/06/21 12:15:54 UTC

Configure bus and conduit programatically in Spring Boot

hi!
I have a spring+cxf app which I'm moving to springboot+cxf (to avoid all
the .xml), but I'm finding the path to configure cxf stuff (bus etc) a bit
hard to figure out.
My original xml-based config which I want to replace is:
https://pastebin.com/tbYRuWX8
and my @Configuration equivalent is https://pastebin.com/jXb5kXQk - but
howto make the HTTPConduit with the matcher pattern?

Seems like others are struggling with the same:
http://trabajosdesisifo.blogspot.no/2016/04/camel-cxf-spring-boot-web-service-proxy.html

Any advice - have others gone down this path?

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Configure bus and conduit programatically in Spring Boot

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I think you will need to have something similar to what I did for JAX-RS:

https://github.com/apache/cxf/blob/master/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/JaxRsWebClientConfiguration.java
https://github.com/apache/cxf/blob/master/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/AbstractJaxRsClientConfiguration.java

https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java

though it only covers auto-wiring a bus, as far as HTTPConduit is 
concerned - it may still be simpler to import an XML file where it is set

Cheers, Sergey
On 21/06/17 13:15, David Karlsen wrote:
> hi!
> I have a spring+cxf app which I'm moving to springboot+cxf (to avoid all
> the .xml), but I'm finding the path to configure cxf stuff (bus etc) a bit
> hard to figure out.
> My original xml-based config which I want to replace is:
> https://pastebin.com/tbYRuWX8
> and my @Configuration equivalent is https://pastebin.com/jXb5kXQk - but
> howto make the HTTPConduit with the matcher pattern?
> 
> Seems like others are struggling with the same:
> http://trabajosdesisifo.blogspot.no/2016/04/camel-cxf-spring-boot-web-service-proxy.html
> 
> Any advice - have others gone down this path?
> 

Re: Configure bus and conduit programatically in Spring Boot

Posted by David Karlsen <da...@gmail.com>.
Anyone have a comment to this?

2017-06-22 23:06 GMT+02:00 David Karlsen <da...@gmail.com>:

> Actually I had to switch the code:
>
> JaxWsProxyFactoryBeanDefinitionParser.JAXWSSpringClientProxyFactoryBean clientProxyFactoryBean = new JaxWsProxyFactoryBeanDefinitionParser.JAXWSSpringClientProxyFactoryBean();
> //ClientProxyFactoryBean clientProxyFactoryBean = new ClientProxyFactoryBean()
>
>
> or else it could not resolve the wsdl set with setWsdlLocation( ... ) in
> order to do the full schema-level validation. Is this the correct way to
> solve it? It seems a bit hackish since it's an inner class of the bean def
> parser - cxf seems to be oriented towards the xml-way of using spring? WIll
> that change?
>
> 2017-06-21 14:35 GMT+02:00 David Karlsen <da...@gmail.com>:
>
>> Great - thanks for your swift answer!
>>
>> 2017-06-21 14:21 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:
>>
>>> You can use the HttpConduitFeature. I created this for CXF-DOSGi but it
>>> works for any programmatic cxf config.
>>>
>>> https://github.com/apache/cxf-dosgi/blob/master/samples/ssl/
>>> ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/Ss
>>> lIntent.java#L55-L74
>>>
>>> Christian
>>>
>>> On 21.06.2017 14:15, David Karlsen wrote:
>>>
>>>> hi!
>>>> I have a spring+cxf app which I'm moving to springboot+cxf (to avoid all
>>>> the .xml), but I'm finding the path to configure cxf stuff (bus etc) a
>>>> bit
>>>> hard to figure out.
>>>> My original xml-based config which I want to replace is:
>>>> https://pastebin.com/tbYRuWX8
>>>> and my @Configuration equivalent is https://pastebin.com/jXb5kXQk - but
>>>> howto make the HTTPConduit with the matcher pattern?
>>>>
>>>> Seems like others are struggling with the same:
>>>> http://trabajosdesisifo.blogspot.no/2016/04/camel-cxf-spring
>>>> -boot-web-service-proxy.html
>>>>
>>>> Any advice - have others gone down this path?
>>>>
>>>>
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Configure bus and conduit programatically in Spring Boot

Posted by David Karlsen <da...@gmail.com>.
Actually I had to switch the code:

JaxWsProxyFactoryBeanDefinitionParser.JAXWSSpringClientProxyFactoryBean
clientProxyFactoryBean = new
JaxWsProxyFactoryBeanDefinitionParser.JAXWSSpringClientProxyFactoryBean();
//ClientProxyFactoryBean clientProxyFactoryBean = new ClientProxyFactoryBean()


or else it could not resolve the wsdl set with setWsdlLocation( ... ) in
order to do the full schema-level validation. Is this the correct way to
solve it? It seems a bit hackish since it's an inner class of the bean def
parser - cxf seems to be oriented towards the xml-way of using spring? WIll
that change?

2017-06-21 14:35 GMT+02:00 David Karlsen <da...@gmail.com>:

> Great - thanks for your swift answer!
>
> 2017-06-21 14:21 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:
>
>> You can use the HttpConduitFeature. I created this for CXF-DOSGi but it
>> works for any programmatic cxf config.
>>
>> https://github.com/apache/cxf-dosgi/blob/master/samples/ssl/
>> ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/Ss
>> lIntent.java#L55-L74
>>
>> Christian
>>
>> On 21.06.2017 14:15, David Karlsen wrote:
>>
>>> hi!
>>> I have a spring+cxf app which I'm moving to springboot+cxf (to avoid all
>>> the .xml), but I'm finding the path to configure cxf stuff (bus etc) a
>>> bit
>>> hard to figure out.
>>> My original xml-based config which I want to replace is:
>>> https://pastebin.com/tbYRuWX8
>>> and my @Configuration equivalent is https://pastebin.com/jXb5kXQk - but
>>> howto make the HTTPConduit with the matcher pattern?
>>>
>>> Seems like others are struggling with the same:
>>> http://trabajosdesisifo.blogspot.no/2016/04/camel-cxf-spring
>>> -boot-web-service-proxy.html
>>>
>>> Any advice - have others gone down this path?
>>>
>>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: Configure bus and conduit programatically in Spring Boot

Posted by David Karlsen <da...@gmail.com>.
Great - thanks for your swift answer!

2017-06-21 14:21 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:

> You can use the HttpConduitFeature. I created this for CXF-DOSGi but it
> works for any programmatic cxf config.
>
> https://github.com/apache/cxf-dosgi/blob/master/samples/ssl/
> ssl-intent/src/main/java/org/apache/cxf/dosgi/samples/ssl/Ss
> lIntent.java#L55-L74
>
> Christian
>
> On 21.06.2017 14:15, David Karlsen wrote:
>
>> hi!
>> I have a spring+cxf app which I'm moving to springboot+cxf (to avoid all
>> the .xml), but I'm finding the path to configure cxf stuff (bus etc) a bit
>> hard to figure out.
>> My original xml-based config which I want to replace is:
>> https://pastebin.com/tbYRuWX8
>> and my @Configuration equivalent is https://pastebin.com/jXb5kXQk - but
>> howto make the HTTPConduit with the matcher pattern?
>>
>> Seems like others are struggling with the same:
>> http://trabajosdesisifo.blogspot.no/2016/04/camel-cxf-spring
>> -boot-web-service-proxy.html
>>
>> Any advice - have others gone down this path?
>>
>>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen