I'm trying to dynamically create a RESTful URL based on the incoming XML:
Input:
<message>
<request name="John"/>
</message>
I want to route it like this:
http://myhost:8080/myservice?name=John
I know how to set URL parameters using setHeader but I don't know how to extract the attribute values from the input message. The SOOPER_XPATH expression I'm looking for might look like this:
from("direct:start")
.setHeader(Exchange.HTTP_QUERY,
simple("name=$SOOPER_XPATH(${in.body}, '//request/@name')")
.to("http://myhost:8080/myservice").log("Received response: ${in.body});
'//request/@name'?