我目前正在使用 MSXML 读取外部 XML 提要的经典 ASP (VB) 页面。
虽然这在我的电脑上的 localhost 中没有问题(达到 ReadyState 4),但一旦代码在服务器上,它就会超时,并出现以下错误:
msxml3.dll error '80072ee2'
The operation timed out
我尝试过使用 setTimeouts,但无济于事。
我想知道它是否可能是 IIS 中的设置,或者可能是已卸载的功能?代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%' setup the URL
baseUrl ="http://w1.weather.gov/xml/current_obs/index.xml"
'/////Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
Set myXML =Server.CreateObject("MSXML2.DOMDocument.3.0")
myXML.Async=False
http.open "GET", baseUrl, False
http.setRequestHeader "PREFIX", "prefix"
http.setTimeouts 30000, 60000, 30000, 240000
' send the HTTP data
http.send()
response.write("<BR>ReadyState is... "&http.ReadyState&"<BR>")
if http.ReadyState<>4 then
http.waitForResponse 3
response.write "server is down!"
response.End()
else
if Not myXML.load(http.responseXML) then 'an Error loading XML
returnString = ""
response.write("<br>error<br>")
Else 'parse the XML
Set nodesStationIndex=myXML.documentElement.selectNodes("//wx_station_index")
For each wx in nodesStationIndex
Set nodesStation=wx.selectNodes("station")
For each NS in nodesStation
Set nodesStatID=NS.selectNodes("station_id")
For each NS_ID in nodesStatID
response.write("<BR>"&NS_ID.text&"<BR>")
'response.flush()
next
next
next
End If 'end - XML load error check
end if 'end - ReadyState check
%>