I have a custom message -

etlms~
Message-Profile-Id=FPC-MAIN-REQUEST|
Correlation-Id=123456_ABCDEFG|
~<?xml version="1.0" encoding="UTF-8"?>
<ServicesRequest
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="../ServicesRequest1.xsd"
MessageType="Request">
        <ServiceRequested status="accepted"/>
</ServicesRequest>

Using the preprocessor, I am getting the xml message from the custom in
process method and setting it in exchange.getIn().setBody(etlmsXml).
I have also added convertBodyTo

from(endpointuri) 
        .process(new etlmsXmlProcess)
        .convertBodyTo(String.class,"UTF-8")

Now for this message, I am trying to use Content Based Routing - XPATH.

But for the above message I am getting an error -

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:
/ServiceRequest/@MessageType[@MessageType='Request']. Reason:
javax.xml.xpath.XPathExpressionException: org.xml.sax.SAXParseException:
Content is not allowed in prolog.

Note: I am using Camel DSL. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Getting-error-Content-Based-Routing-for-the-xml-tp5756871.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to