Hi,
Forwarding to the users list.
On 26/03/12 15:36, Zemin Hu wrote:
Hi,
I have couple of RESTful web service that I want to use Camel as integration
point. I had a brief review for restlet which is supposed to be the
solution, but from I have seen, it's not straight forward to use:
1. straight forward support/constrcut RESTful dynamic URL for both<from/>
and<to/>:
http://host:port/services/{uid}/table1/{item_id}
2. it supports request methods GET,POST,PUT, DELETE, I did not see how Camel
handles these methods.
Can Camel handle dynamic URL construction with variables? in ideal case, it
should support:
<from uri="servlet:///myservices/{uid}/table1/{item_id}/1.0" />
<to
uri="http://host:port/services/{uid}/table1/${header.type}?access_token=12345
/>
One option is to use a cxfrs component:
http://camel.apache.org/cxfrs.html
The variation on it is to use the Camel transport and link directly to
CXF JAXRS endpoint declarations (jaxrs:server), example
<jaxrs:server address="camel://direct:bookStore"
serviceClass="service.BookStoreImpl"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<!-- JMS to CXF JAX-RS -->
<route>
<from uri="jms://test.bookStore"/>
<to uri="direct:bookStore"/>
</route>
<!-- Jetty to CXF JAX-RS -->
<route>
<from
uri="jetty:http://0.0.0.0:9002/bookstore?matchOnUriPrefix=true"/>
<to uri="direct:bookStore"/>
</route>
</camelContext>
HTH, Sergey
Since many social network APIs are in this format, for instance:
http://graph.facebook.com/{uid}/picture
http://graph.facebook.com/{uid}/friends
http://graph.facebook.com/{uid}/{about_everything}
Can Camel at least support dynamic construction of URL of out box even
without PUT and DELETE support?
I don't know how big effort is needed to do this. If required, I am willing
to contribute.
Zemin
--
View this message in context:
http://camel.465427.n5.nabble.com/RESTful-web-service-support-from-Camel-tp5595408p5595408.html
Sent from the Camel Development mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com