简体   繁体   English

SAXException = XML文档结构必须在同一实体内开始和结束

[英]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.

相关问题 SAXParseException XML文档结构必须在同一实体中开始和结束 - SAXParseException XML document structures must start and end within the same entity XML 文档结构必须在同一实体内开始和结束 - XML document structures must start and end within the same entity SAXParseException:XML文档结构必须在同一实体中开始和结束 - SAXParseException: XML document structures must start and end within the same entity SAX:XML文档结构必须在同一实体内开始和结束 - SAX: XML document structures must start and end within the same entity XML 文档结构必须在同一实体内开始和结束吗? - XML document structures must start and end within the same entity? javax.xml.bind.UnmarshalException:XML文档结构必须在同一实体内开始和结束 - javax.xml.bind.UnmarshalException: XML document structures must start and end within the same entity XML错误:“ XML文档结构必须在同一实体内开始和结束。” - XML Error: “XML document structures must start and end within the same entity.” XML文档结构必须在同一实体内开始和结束。 使用xslt将xml转换为html - XML document structures must start and end within the same entity. xml to html using xslt 在 netbeans 中清理和构建 javafx 应用程序时出错,XML 文档结构必须在同一实体中开始和结束 - error while cleaning and building javafx app in netbeans, XML document structures must start and end within the same entity eclipse中的SaxParseException:XML文档结构必须在同一实体内开始和结束 - SaxParseException in eclipse: XML document structures must start and end within the same entity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM