camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From miguelfdez <fernandezmartinezmig...@gmail.com>
Subject "When" clause not working with header element with namespace
Date Thu, 13 Nov 2014 13:03:04 GMT
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.

Mime
View raw message