[英]SAXException=XML document structures must start and end within the same entity
Can someone tell me why I'm getting this parse error? 有人可以告诉我为什么会出现此解析错误吗? The XML looks fine to me. XML对我来说看起来不错。 It's failing with SAXException=XML document structures must start and end within the same entity.
由于SAXException=XML document structures must start and end within the same entity.
失败,因此SAXException=XML document structures must start and end within the same entity.
At this line: 在这一行:
Document doc = builder.parse(inputSource); //fails here
Here is the code: 这是代码:
String soapIn = "<?xml version='1.0' encoding='UTF-8' ?>\n" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:vid=\"http://videocontrollerchannelmap.queryservice.vcwh.oss.my.company.com/\">\n" +
" <soapenv:Header/>\n" +
" <soapenv:Body>\n" +
" <vid:getInneoquestChannelMap>\n" +
" <appkey>ONE_CONTROLLER</appkey>\n" +
" <forceUpdate>true</forceUpdate>\n" +
" </vid:getInneoquestChannelMap>\n" +
" </soapenv:Body>\n" +
"</soapenv:Envelope";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
SOAPMessage newMsg = null;
try {
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource inputSource = new InputSource(new StringReader(soapIn));
Document doc = builder.parse(inputSource); //fails here
DOMSource domSource = new DOMSource(doc);
你缺少>
上"</soapenv:Envelope"
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.