Camel route depending on header. Namespace breaks condition



I'm following the "Message Router" pattern explained in http://ift.tt/1Eyn7Dh However, I'm having problems with conditions on headers with namespaces.


The XML message I'm receiving is like this:



<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://ift.tt/sVJIaE">
<SOAP-ENV:Header>
<DF xmlns="http://mycompany/smth">myElement</DF>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:processIncomingMessage xmlns:ns2="http://a.namespace.com/">
<arg0>something</arg0>
</ns2:processIncomingMessage>
</SOAP-ENV:Body></SOAP-ENV:Envelope>


And this is my route:



from("switchyard://CamelInterfaceService")
.log("Header: ${headers}")
.log("Received message for 'CamelInterfaceService' : ${body}")
.choice()
.when(header("DF").isEqualTo("myElement"))
.to("switchyard://OtherService")
.log("SENT.........")
.end();


However, "OtherService" is not called.


If I change myElement to: myElement it works...but it is something I cannot really change...so, how can I modify my camel route to make it work?


Thank you!


No comments:

Post a Comment