camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vizaac <>
Subject REST Proxy Service
Date Wed, 01 May 2013 03:24:38 GMT

My requirement is to expose a REST service, a mobile device will call my
REST service, my REST will then call either another REST service or any SOAP
web service based on the route configuration. My route can have multiple
<to:uri> segments so that I can even call multiple REST services or soap

I may need to transform the incoming parameters (headers/body) from mobile
from rest to soap or some other transformation before I can call another web
service from my REST service.

The output of my REST service should be the aggregation result from various
calls that my REST service is making. 

So I have 3 cases. 

1) Call a (single/multiple) REST service(s) from my REST service
2) Call a (single/multiple) SOAP service(s) from my REST service.
3) Call combination of REST or SOAP services from my REST service.

The ExchangePattern should be InOut so that I can respond back with the
aggregated results from various calls.

*So far I have come up with this route:*

<camelContext xmlns="">
     <route id="testme">
       <from uri="cxfrs:bean:rsServer"/>
       <process ref="simpleprocessor"/>
       <to uri="cxfrs:bean:rsClient"/>

*My Exposed Webservice that Mobile device will call:*

<cxf:rsServer id="rsServer" address="http://localhost:9090" 
 	serviceClass="com.test.AdapterLayer.TestRest" />
*To invoke other REST services:*

<cxf:rsClient id="rsClient1" address=""
    loggingFeatureEnabled="true" />



			exchange.getIn().setHeader(Exchange.HTTP_METHOD, "PUT");   

Now my problems are:

1) How do I get this structure work when I want to call multiple webservices
? How will my route look like and how will use aggregation to do some
processing with response from every webservice and finally prepare a final
response that I need to send out.

2) If I don't set 	exchange.getIn().setBody(null); then the entire thing
doesn't work, I get an exception. 

3)  how does this class (com.test.AdapterLayer.TestImpl) helps in response,
is it an unmarshalled object or something? :

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message