加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

解析XML文档时发生错误

发布时间:2020-12-16 22:41:49 所属栏目:百科 来源:网络整理
导读:我在服务调用返回 XML响应时收到此错误. 我无法找到,这个问题已经发生了一段时间. 错误: An error occured while Parsing an XML document.The element type "hr" must be terminated by the matching end-tag "/hr" (评论更新) 我从IP Address Geolocation
我在服务调用返回 XML响应时收到此错误.
我无法找到,这个问题已经发生了一段时间.

错误:

An error occured while Parsing an XML document.
The element type "hr" must be terminated by the matching end-tag "</hr>"

(评论更新)

我从IP Address Geolocation XML API获取XML.下面是XML响应.大多数时候,我得到错误是正确的.

XML响应:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <statusCode>OK</statusCode>
  <statusMessage>
  </statusMessage>
  <ipAddress>x.x.x.x</ipAddress>
  <countryCode>US</countryCode>
  <countryName>UNITED STATES</countryName>
  <regionName>NEW YORK</regionName>
  <cityName>NEW YORK CITY</cityName>
  <zipCode>10112</zipCode>
  <latitude>40.7143</latitude>
  <longitude>-72.006</longitude>
  <timeZone>-03:00</timeZone>
</Response>

解决方法

请求被提供给服务或服务本身可能存在问题,并且服务正在返回,而不是预期的良好XML消息,而是包含未终止的水平规则(hr)元素的HTML错误页面.检查HTML以获取有关您的请求可能需要执行的操作的线索.请务必考虑服务是否期望您POST到其端点而不是GET.检查Accept标头的介质类型.还要检查身份验证最后,确保您没有不正确地重新使用缓冲区,以便在服务的正确XML响应之前或之后存在残留的HTML.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读