Skip to Content

Call GET RESTful service based on XML elements

Hi Experts,

Say I have a sample input XML as below


In the iFlow, I need to traverse the XML, get all the values in each of the elements, use them as Address in the Receiver HTTP channel and trigger the service call.

So in the sample code, there has to be 3 GET web service calls.

For the response processing, I don't need to aggregate them. So I'm thinking of just writing each response for every call to the Data Store.

Is this feasible?


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Posted on Jan 24, 2017 at 10:40 PM

    Hi Mark

    Your solution will look something like the following:

    Set the Splitter (note that there is no Gather step) to split the input with XPath expression /root/element.

    In the Content Modifier, create header CamelHttpUri, and set its value to the XPath expression /root/element. This will set the HTTP channel address for each iteration.

    Finally, add whatever processing you need between the Request-Reply step and the End step.

    Have fun :-)



    iflow.png (20.4 kB)
    Add comment
    10|10000 characters needed characters exceeded