我正在尝试分析格式为XML的httprequest的输出。我使用MSXML2.DOMDocument将响应加载为XML但我收到此错误:
系统找不到指定的路径。
当我收到httpsquest ResponseText 时,这是输出:
<?xml version="1.0" encoding="utf-8"?>
<resultObj>
<result>False</result>
<invoiceNumber>1</invoiceNumber>
<referenceNumber>21669145</referenceNumber>
<transactionDate>2016/05/18 20:10:07</transactionDate>
</resultObj>
这是我的Vbscript代码,用于将结果加载为XML文件:
data= "invoiceUID=1"
Set httpRequest = Server.CreateObject("MSXML2.XMLHTTP.6.0")
httpRequest.Open "POST", "https://some url", False
httpRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
httpRequest.Send data
postResponse = httpRequest.ResponseXML.xml
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load(postResponse) ///// I think this line fails
If xmlDOM.ParseError <> 0 Then
response.write xmlDOM.ParseError.Reason
Else
response.write "file loaded"
End If