我想捕捉我的Hikvision的日志细节。为了捕获日志,HikVision在其RACM规范文档中提供REST服务。在使用该服务时,我得到了badXMLFormat错误的响应。
请在下面找到问题的详细描述。
设备详细信息:
设备名称:嵌入式网络DVR产品编号:DS-7208HQHI-F1固件版本:V3.4.80
服务网址:http://myDVRStaticIPAddress/ISAPI/ContentMgmt/logSearch方法: POST
输入/请求主体
<?xml version="1.0" encoding="UTF-8"?>
<CMSearchDescription version="1.0"
xmlns="http://www.isapi.org/ver20/XMLSchema">
<searchID>{812F04E0-4089-11A3-9A0C-0305E82C2906}</searchID>
<timeSpanList>
<timeSpan>
<startTime>2013-06-10T12:00:00Z</startTime>
<endTIme>2013-06-10T13:30:00Z</endTime>
<timeSpan>
</timeSpanList>
<metaID>log.hikvision.com/Alarm/motionstart</metaID>
<searchResultPostion> 20 </searchResultPostion>
<maxResults> 40 </maxResults>
</CMSearchDescription> 响应
<?xml version="1.0" encoding="UTF-8" ?>
<ResponseStatus version="1.0" xmlns="urn:psialliance-org">
<requestURL>/ISAPI/ContentMgmt/logSearch</requestURL>
<statusCode>5</statusCode>
<statusString>Invalid XML Format</statusString>
<subStatusCode>badXmlFormat</subStatusCode>
</ResponseStatus>我得到了statusCode 5的上述服务。我的输入xml(CMSearchDescription)似乎没有正确的格式或更新的格式。
服务名称:/ISAPI/ContentMgmt/logSearch
如能在此问题上提供任何帮助,将不胜感激。
提前谢谢。
发布于 2019-06-20 10:50:20
我在我的测试系统上做了这个工作,它需要对XML进行一些更改,因为它没有正确的格式化。(以前的评论中提到了其中的一些)
</timeSpan>,您错过了/<endTIme>的开头标签,它应该是没有大写I的<endTime>。metaID应该是没有大写D的metaId。而且,我不能完全测试您的metaId标记,因为在该类别中没有任何匹配项。
这个log.std-cgi.com肯定会提取所有的日志条目,而这个log.std-cgi.com/Alarm会返回所有的警报条目。
这是完整的Xml
<?xml version='1.0' encoding='UTF-8'?>
<CMSearchDescription version='1.0' xmlns='http://www.isapi.org/ver20/XMLSchema'>
<searchID>{812F04E0-4089-11A3-9A0C-0305E82C2906}</searchID>
<timeSpanList>
<timeSpan>
<startTime>2013-06-10T12:00:00Z</startTime>
<endTime>2013-06-10T13:30:00Z</endTime>
</timeSpan>
</timeSpanList>
<metaId>log.hikvision.com/Alarm/motionstart</metaId>
<searchResultPostion>20</searchResultPostion>
<maxResults>40</maxResults>
</CMSearchDescription>发布于 2018-04-24 10:41:45
Hikvision/Annke设备不正确地返回内容类型。
您将在HTTP响应头中看到以下内容:
Content-Type: application/xml; charset="UTF-8"
注意"UTF-8"
您的HTTP客户端无法用双引号确定字符集"UTF-8“。如果您可以在XML解析器读取内容之前修改响应头,那么您就足够了。将标头更改为Content-Type: application/xml; charset=utf-8
双引号字符集是标准的一部分,并受到大多数浏览器的尊重。
发布于 2018-11-15 00:35:50
有点晚了。
xmlns="http://www.isapi.org/ver20/XMLSchema")。3.7绝对时间 绝对时间表示为ISO 8601时间戳,使用UTC (GMT)。可以表示秒的分数。utc-range = "clock“=”utc-time "-“utc-time -time= utc-date "T”utc-time "Z“utc-date =8 6DIGIT;< YYYYMMDD > utc-time =6 6DIGIT”。分数;< HHMMSS.fraction >1996年11月8日14h37和20秒的例子UTC: 19961108T143720.25Z
https://stackoverflow.com/questions/45995307
复制相似问题