You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rado <ra...@dell.com> on 2013/01/03 18:45:53 UTC

CXFRS client from Camel route

Hi Guys,
here is my situation:
1. We need to consume an external REST Web Service exposed and maintained by
3-rd party;
2. This service accepts POST requests with XML payload based on which it
creates a resource;

3. In our current Camel route we call a REST client bean like this:
...
<to uri="velocity://velocity/custody-trade-request.vm" /> 
<log message="XML payload to send to REST WS:${body}" /> 
*<bean ref="restClient" method="createResource('${body}')" />*

and here is the restClient config (in the sping context):
<jaxrs:client id="restClient"
address="http://localhost:8080/my-rest-service/services"  
		serviceClass="com.my.services.rs.client.ExampleResource" >
        <jaxrs:headers>
             <entry key="Charset" value="UTF-8"/>
             <entry key="Accept" value="application/xml"/>
        </jaxrs:headers>
</jaxrs:client>

4. The com.my.services.rs.client.ExampleResource is just an interface and
looks like this:
public interface ExampleResource {

	@POST
	@Path(value = "/resources/")
	@Produces(MediaType.APPLICATION_XML)
	public String createExampleResource(String exampleResourceXML);
	
}

That all works fine as it is.

However we want to use the cxfrs Camel component instead and replace the
line in bold above with something like this:
*<to uri="cxfrs://bean://restClient"/>*

I have gone through the example in the cxfrs component's doc but coudn't
understand how could i only create cxf:rsClient and use this in my route? 

Thank you for your help.



--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-client-from-Camel-route-tp5724855.html
Sent from the Camel - Users mailing list archive at Nabble.com.