I have an SoapMesagge in XML format which contain Chinese char.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<new:NewOperation xmlns:new="http://www.example.org/NewWSDLFile/">
<in>4) 软件应安全、。</in>
</new:NewOperation>
</soapenv:Body>
</soapenv:Envelope>
To parse this I wrote the code below in JAVA where soapMessage is my message
ByteArrayInputStream is = new ByteArrayInputStream(soapMessage.getBytes());
InputStreamReader isr = new InputStreamReader(is,"UTF-8);
InputSource source=new InputSource(isr);
SAXParser parser = new SAXParser();
parser.parse(source);
It is not able to parse chinese char and throwing below error,please help me to solve this issue.
Fatal Error] :1:1: Content is not allowed in prolog.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
I have tried with Dom Parser as well.