Anita
Anita

Reputation: 185

SAXParseException - when parsing soap response

I am trying to parse below xml using saxparse in java code but i get SAXParseException. xml looks fine. Not sure why i get this exception. Can anyone help me know what is the problem with my xml. Thanks in advance!

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:m0="http://schemas.compassplus.com/two/1.0/fimi_types.xsd" xmlns:m1="http://schemas.compassplus.com/two/1.0/fimi.xsd">
   <env:Body>
      <m1:UserDefinedRp>
         <m1:Response Response="1" TranId="7643629" Ver="14.3" Product="XXX"/>
      </m1:UserDefinedRp>
   </env:Body>
</env:Envelope>

Below is the exception i get:

org.xml.sax.SAXParseException: Element type "env:Envelope" must be followed by either attribute specifications, ">" or "/>".
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
    at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:579)
    at org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentScanner.java:628)
    at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1800)
    at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)
    at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)

Upvotes: 2

Views: 726

Answers (1)

Hrabosch
Hrabosch

Reputation: 1583

If you think it is correct XML (yes, it looks fine) try to check nonprintable chars, sometimes IDE or other editors add them. Try to check it.

Upvotes: 1

Related Questions