我正在尝试使用 XrmServiceToolkit for CRM 2015 解析来自 XMLHttpRequest 的响应。解析结果的代码在 IE 11 中运行良好,但在 Chrome 中无法正常运行。请协助。
以下是详细信息:
var requestMain = ""
requestMain += " <request i:type=\"b:RetrieveRecordChangeHistoryRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\" xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">";
requestMain += " <a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">";
requestMain += " <a:KeyValuePairOfstringanyType>";
requestMain += " <c:key>Target</c:key>";
requestMain += " <c:value i:type=\"a:EntityReference\">";
requestMain += " <a:Id>" + entityId + "</a:Id>";
requestMain += " <a:LogicalName>" + entityName + "</a:LogicalName>";
requestMain += " <a:Name i:nil=\"true\" />";
requestMain += " </c:value>";
requestMain += " </a:KeyValuePairOfstringanyType>";
requestMain += " </a:Parameters>";
requestMain += " <a:RequestId i:nil=\"true\" />";
requestMain += " <a:RequestName>RetrieveRecordChangeHistory</a:RequestName>";
requestMain += " </request>";
var changeHistoryResponse = XrmServiceToolkit.Soap.Execute(requestMain);
var results = changeHistoryResponse.getElementsByTagName("a:Results")[0];
...
var auditRecords = results.childNodes[0].childNodes[1].getElementsByTagName("b:AuditDetail");
该行在changeHistoryResponse.getElementsByTagName("a:Results")[0];
IE 中运行良好,但null
在 Chrome 中返回。因此,代码的另一部分正在抛出错误
var auditRecords = results.childNodes[0].childNodes[1].getElementsByTagName("b:AuditDetail");
无法读取
childNodes
未定义的属性“ ”