I am trying to develop a content-based routing camel application. This application will look at the folder src/data to see if there is a SOAP request file that has node <e2d:getOrderDetaiRequest>
, then that file will be copy into target/message, otherwise the file will be copy to target/other.
Do you know how to use xpath(or any other tools ) to check that condition (i prefer using camel-context.xml file)?
Here is my camel-context
<route>
<from uri="file://c:/src/data?noop=true"/>
<choice>
<when>
<xpath>**???????????????????????????**</xpath>
<to uri="file://c:/target/message"/>
</when>
<otherwise>
<to uri="file://c:/target/other"/>
</otherwise>
</choice>
</route>
And here is the sample of 2 different SOAP requests
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:e2d="http://www.abc.com/Abc11WS">
<soapenv:Header/>
<soapenv:Body>
<e2d:getOrderDetailRequest>
<actionCode>1234</actionCode>
</..>
</...></...>
And
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lsr="http://www.abc.com/Abc22WS">
<soapenv:Header/>
<soapenv:Body>
<lsr:getProductDetailsRequest>
<productId>12345</...>
</...></...></...>