Hello All,

I am using this

<setHeader headerName="errorCode">
<xpath>/soapenv:Envelope/soapenv:Body/das:GiftCardUpdateStatusOrderResponseElement/das:body/das:errorCode</xpath>
</setHeader>

For a message

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:xsd="http:
//www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
                <soapenv:Header/>
                <soapenv:Body>
                                <p355:GiftCardUpdateStatusOrderResponseElement 
xmlns:p355="http:/
/credit.tgt.com/schemas/Credit/GiftCardService/V1/2005-06-01">
                                                <p355:header>
                                                                
<p355:clientSystemName>EVEREST</p355:clientSystemName>
                                                                
<p355:matchID>111111111111</p355:matchID>
                                                </p355:header>
                                                <p355:body>
                                                                
<p355:errorCode>50</p355:errorCode>
                                                                
<p355:termNumber>8888</p355:termNumber>
                                                                
<p355:tranNumber>7777</p355:tranNumber>
                                                                
<p355:tranDate>20140705</p355:tranDate>
                                                                
<p355:tranTime>100230</p355:tranTime>
                                                                
<p355:custRefNum>107687549900</p355:custRefNum>
                                                                
<p355:shipToSeqNum>00001</p355:shipToSeqNum>
                                                                
<p355:lineNumber>1</p355:lineNumber>
                                                </p355:body>
                                </p355:GiftCardUpdateStatusOrderResponseElement>
                </soapenv:Body>
</soapenv:Envelope>


And I get the error as

2015-09-21 16:16:42,222 | WARN  | OMS.EGC.SA.DATA] | DeadLetterChannel          
      | ?                                   ? | 143 - 
org.apache.camel.camel-core - 2.12.0.redhat-6
11423 | Failed delivery for (MessageId: ID-797SD02-64971-1442806145971-25-2 on 
ExchangeId: ID-797SD02-64971-1442806145971-25-1). On delivery attempt: 0 
caught: org.apache.camel.bu
ilder.xml.InvalidXPathExpression: Invalid xpath: 
/soapenv:Envelope/soapenv:Body/das:GiftCardUpdateStatusOrderResponseElement/das:body/das:errorCode.
 Reason: javax.xml.xpath.XPathE
xpressionException: net.sf.saxon.trans.XPathException: 
org.xml.sax.SAXParseException: Premature end of file.


I have set the namespaces on camel context as this

<camelContext id="camelContext"
              xmlns="http://camel.apache.org/schema/blueprint"; 
errorHandlerRef="EH1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:das="http://credit.tgt.com/schemas/Credit/GiftCardService/V1/2005-06-01";>


Can someone please point out where its going wrong?

Reply via email to