MSXML ASP经典供稿页面 - 超时和ReadyState卡在1上

时间:2015-11-05 20:49:33

标签: xml asp-classic msxml readystate serverxmlhttp

我目前正在使用经典ASP(VB)中的一个页面,该页面利用MSXML读取外部XML提要。
虽然这在我的电脑上的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


%>

1 个答案:

答案 0 :(得分:0)

我想跟进这个。
事实证明,控制集中权限等的本地(中央)IT部门确实阻止了XML Feed所需的URL。 现在它已被解锁,代码(上面)成功运行。

感谢大家的帮助。