2015-11-05 126 views
0

我目前正在使用MSXML讀取外部XML提要的經典ASP(VB)中的頁面上工作。
雖然這個工作沒有問題(readyState的4到達)在本地主機上的我的電腦,一旦代碼是在服務器上,超時,與此錯誤:MSXML ASP經典的Feed頁面 - 超時和ReadyState卡住了1

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 


%> 
+0

不要在同一腳本中混合使用MSXML版本。如果你調用'MSXML2.DOMDocument.3.0',那麼調用'MSXML2.ServerXMLHTTP.3.0',如果你調用'MSXML2.DOMDocument.6.0'然後調用'MSXML2.ServerXMLHTTP.6.0'。使用6.0除非你有特定的理由不要。 – John

+0

謝謝。我已經糾正了這個問題,但仍然存在超時問題。有誰知道這個很好的故障排除步驟?日誌表示發生了500錯誤,但沒有更多信息可用。 我已經看到這個超時問題的不少地方,沒有解決。 – buck1112

回答

0

我想跟進這一點。
事實證明,我們控制集中權限等的本地(中央)IT部門的確在阻止XML提要所需的URL。
現在它已暢通無阻,並且代碼(上述)成功運行。

感謝大家的幫助。