On Fri, Jun 25, 2010 at 10:41 PM, James Carman
<[email protected]> wrote:
> There is a web service at my company that returns XML documents, but
> you have to query it using a query string. I want to send the single
> parameter (an id) as the body of the incoming message and I want to
> append that body value to the HTTP URL. So, I want something like:
>
> http://my.service.url/service.cgi?id=${body}
>
> Is that possible using the Java DSL?
>
Yes you can for example use the setHeader to set the id header beforehand
.setHeader("id").simple("${body}").to("http://xxxx");
Or use the recipient list to construct a dynamic uri
http://camel.apache.org/recipient-list.html
.recipientList().simple("http://xxxx?id=${body}");
We use the Camel expression language, simple, to define the dynamic expression:
http://camel.apache.org/simple.html
> Thanks,
>
> James
>
> p.s. Camel Rocks! I've downloaded the MEAP Camel in Action book and
> I'm working my way through it. Very cool indeed!
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus