4 Replies Latest reply on Nov 28, 2014 6:30 PM by jorgemoralespou_2

    Camel route depending on header. Namespace breaks condition

    mfernandezmartinez

      I'm trying to create a Switchyard project with a Camel component 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://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:

      <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!