Search code examples
xmlxpathjbossapache-camelfuseesb

how to use setProperty in FUSE ESB


I have following XML:

<sam:Order>
   <Order1>
   <OrderNo>12345</OrderNo>
    <OrderDate>13-08-2015</OrderDate>
    <OrderMode>online</OrderMode>
    </Order1>
 </sam:Order>

My Camel route:

  <setProperty propertyName="IncomingSoapMessage">
                <xpath  xmlns:sam="http://Order.com/">/sam:Order</xpath>
  </setProperty>
  use enrich/split.... some any components....      

  <log message="${body}"/>

So, is it right way to use setProperty. The property "IncomingSoapMessage" must have following XML

<Order1>
<OrderNo>12345</OrderNo>
<OrderDate>13-08-2015</OrderDate>
<OrderMode>online<OrderMode>
</Order1>

Also this property should be the current message in context(in simple words it should be the payload). i.e; when i log message using ${body}, i should be able to see XML as

   <Order1>.....</Order1>

Please suggest me the solution to this!!! In case of any clarification pls comment..


Solution

  • I think he asking for logic to retrieve child elements from XML and keep it in the flow.

    <sam:Order>
        <Order1>
            <OrderNo>12345</OrderNo>
            <OrderDate>13-08-2015</OrderDate>
            <OrderMode>online</OrderMode>
        </Order1>
    </sam:Order>
    

    This to be modified as:

    <Order1>
        <OrderNo>12345</OrderNo>
        <OrderDate>13-08-2015</OrderDate>
        <OrderMode>online</OrderMode>
    </Order1>
    

    and sent for further camel components.