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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.