You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by miguelfdez <fe...@gmail.com> on 2014/11/13 14:03:04 UTC

"When" clause not working with header element with namespace

Hi!

I'm following the "Message Router" pattern explained in
https://camel.apache.org/message-router.html
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://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<DF xmlns="http://mycompany/smth">myElement</DF>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:processIncomingMessage xmlns:ns2="http://ws.eta.ea.efca.europa.eu/">
<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
<DF xmlns="http://mycompany/smth">myElement</DF>
to:
<DF>myElement</DF>
it works...but it is something I cannot really change...so, how can I modify
my camel route to make it work?

Thank you!



--
View this message in context: http://camel.465427.n5.nabble.com/When-clause-not-working-with-header-element-with-namespace-tp5759046.html
Sent from the Camel - Users mailing list archive at Nabble.com.