ContentBasedRouter with XPath expressions does not work if input contains namespace declarations in SOA-P 5

Solution Unverified - Updated -

Issue

  • When the input document contains namespace declarations, the XPath ContentBasedRouter does not work.
  • Using the following SOAP message XML input:
<order xmlns:orderinput="http://localhost/demo/orderinput" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <PurchaseOrder>
    <OrderHeader>
      <OrderType>PO</OrderType>
      <OrderNumber>123</OrderNumber>
      <OrderValue>400</OrderValue>
      <OrderDate>2010-04-10T12:00:00-05:00</OrderDate>
      <Action>create-order</Action>
    </OrderHeader>
    <OrderLines>
      <Line>
        <LineNumber>1</LineNumber>
        <Quantity>4</Quantity>
        <ProductId>ID9999</ProductId>
      </Line>
    </OrderLines>
  </PurchaseOrder>
</order>
  • Using the following Xpath CBR:
<action class="org.jboss.soa.esb.actions.ContentBasedRouter"
  name="Route to manual or automatic order flow" process="process">
  <property name="cbrAlias" value="Xpath"/>
  <property name="destinations">
    <route-to 
      expression="/order/PurchaseOrder/OrderHeader/Action[text() != 'create-order']"
      service-category="Demo" service-name="UpdateOrDeleteOrder"/>
    <route-to
      expression="/order/PurchaseOrder/OrderHeader/Action[text() = 'create-order']"
      service-category="Demo" service-name="CreateOrder"/>
  </property>
</action>
  • Results in:
ERROR [ContentBasedWiretap] No rule destination(s) [..] were matched, . Please fix your configuration and/or routing rules.
  • The problem seems to be the namespace declaration, as using an input file without those works fine.

Environment

  • Red Hat JBoss SOA Platform (SOA-P)
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content