Hi,

It is very poplar that people use Spring to configure their CXF Server and CXF Client. You can setup the Interceptors, Bindings , ServiceFactory , even the WS* features through the Spring configuration. It is very powerful to use.

In Camel , we use the URI string to build up the endpoint information. I just checked the Camel Spring module , and found it used the URI as the endpoint description. I don't want to make big change of the Camel Spring module , so I suppose to introduce the SpringBean attribute to CxfEndpoint. This attribute takes the id of the spring bean which could be the Client object for CxfProducer[1] to use or the Serve object for CxfConsumer[2] to use.

Here is an example:
...
<simple:client id="client1"
   serviceClass="org.apache.cxf.service.factory.HelloService"
   address="http://localhost:9000/foo2";
   serviceName="s:XMLService"
   xmlns:s="http://apache.org/hello_world_soap_http";
endpointName="s:XMLPort" bindingId="http://cxf.apache.org/bindings/xformat";> </simple:client>

<simple:server id="server1" address="http://localhost:8080/simpleWithAddress";>
   <simple:serviceBean>
     <bean class="org.apache.cxf.service.factory.HelloServiceImpl"/>
   </simple:serviceBean>
 </simple:server>

<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring";>
   <route>
     <from uri="cxf://SpringBean=server1"/>
     <to uri="cxf://SpringBean=client1"/>
   </route>
</camelContext>

I will add the checking code of the Spring bean instance. We just accept the Client object for the CxfProducer, and the Server object for the CxfConsumer here.
Any thought?

[1]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
[2]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java

Willem.



Reply via email to