camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wolf <>
Subject Re: Need help with cxfrs component, actually RESTful service consumption, in general
Date Fri, 29 Mar 2013 15:09:24 GMT
Ok, before I go the CXF-RS route (no pun intended) I want to try
restlet.  To clarify - can I use restlet to consume any RESTful
or does the service have to be a restlet service?

The example client-side code on the the page:


from("direct:start-auth").to("restlet:http://localhost:" + port +
That is all we need. We are ready to send a request and try out the
restlet component:
final String id = "89531";

Map<String, Object> headers = new HashMap<String, Object>();
headers.put(RestletConstants.RESTLET_LOGIN, "admin");
headers.put(RestletConstants.RESTLET_PASSWORD, "foo");
headers.put("id", id);

String response =
(String)template.requestBodyAndHeaders("direct:start-auth", "<order
foo='1'/>", headers);

I don't need to authenticate, and I only need to do a GET, but the URL
I'm consuming from
has a query string with a parameter whose value is an Xpath


Do I need to URL-Encode the first '?' so I can append "?restletMethod=GET"




On Fri, Mar 29, 2013 at 4:05 AM, Claus Ibsen <> wrote:
> Hi
> There is also camel-restlet
> It may be easier to get hold of and use. But CXF may have more
> configuration options, but is also IMHO harder to get started with
> using - some of that is us to blame, for not having better
> documentation and samples. And the fact that IMHO camel-cxf has both
> WS and RS in the same big giant component, which IMHO is becoming a
> problem and hurts the lightweightness of Camel and CXF.
> You may also take a look at some of the articles about Camel. There
> should be some good ones about REST etc
> For example this article
> But there is others as well.
> On Thu, Mar 28, 2013 at 11:35 PM, Chris Wolf <> wrote:
>> So I have the book, "Camel In Action", which is a very good and
>> thorough treatment of camel-core. However, now my development efforts
>> are starting to hit severe turbulence upon making the jump from
>> camel-core to camel-cxf, in particular, how to consume a RESTful
>> service?
>> I read these:
>> ...but these pages seem to be reference pages for people who have
>> already mastered camel-cxfrs - not newbies, like me.  Can anyone point
>> me to an end-to-end example?  I don't need the server-side - this is
>> legacy and produces XML.
>> N.B. Outside of Camel, I have had much previous experience using CXF
>> for JAX-WS style services, client and server  (never JAX-RS, though)
>> Thanks for any help,
>>   -Chris
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email:
> Web:
> Twitter: davsclaus
> Blog:
> Author of Camel in Action:

View raw message