Please find the below route program,
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="com.performancebikes.RouteScript" autoStartup="false">
<from uri="b2bmbFileSystem:com.performancebikes/tempSFTP/in"/>
<convertBodyTo type="java.lang.String" charset="UTF-8"/>
<convertBodyTo type="org.w3c.dom.Document" charset="UTF-8"/>
<split>
<xpath>/B2B_Documents/B2B_PurchaseOrder/Header/HeaderInfo/PurchaseOrderNumber/text()</xpath>
<setHeader headerName="body">
<constant>${body}</constant>
</setHeader>
<log message="${body}"/>
<to uri="b2bmbScript:com.trainingaccount11/Ship" />
</split>
</route>
</routes>
In this from Xpath expression I am getting the PurchaseOrderNumber as 152346 as expected. now I am setting 152346 to the variable body in the header and send this as input to the script called Ship.
but here is I am not getting 152346 as value to my script. it is going as null.
Please let me know how I can set 152346 value to the header and pass that as a input to my script.
My script is taking the 152346 as input.