SOAP to REST API SAXParserException

Not applicable

Team,

I have configured Apigee Edge API proxy using SOAP service option and PRoxy type as , REST to SOAP to REST.

I could able to trigger most of GET requests through Proxy url by passing json and get the response. But when I invoke a POST Request with JSON template I get below exception.

<faultcode>soapenv:Server.userException</faultcode> <faultstring>org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.</faultstring>

I understand it says, invalid XML content in the beginning element. How can I trace the generated XML Request from JSON?. Please advice.

0 4 482
4 REPLIES 4

Not applicable

Below is the complete response,

<Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.</faultstring> <detail> <faultData type="ns1:SAXParseException"> <cause nil="true" type="ns2:Throwable"/> <columnNumber type="xsd:int">1</columnNumber> <exception nil="true" type="ns3:Exception"/> <lineNumber type="xsd:int">1</lineNumber> <message type="xsd:string">Content is not allowed in prolog.</message> <publicId nil="true" type="xsd:string"/> <systemId nil="true" type="xsd:string"/> </faultData> <hostname>test.company.com</hostname> </detail> </Fault>

Former Community Member
Not applicable

You should be able to enable trace and see what is happening. Trace does not allow you to capture the entire message if it was big. In that case, you'd want to use the Message Logger policy to log the XML message.

But the error is in line 1, column 1. Therefore, regardless of the size of the message or the limit of the data capture in a debugsession, you will be able to see the problem that is causing the SAXParseException in the Trace UI. It's the very first character.

My guess is that this character is neither whitespace nor an open angle bracket. It's something else. And that something else is invalid for an XML document.

Any update, @Manojkumar ?