Car Finance - Repair Bad Credit - Free Ringtones - Debt Consolidation - Cheap Flights

PDA

View Full Version : question about xmlhttp and ASP


gworld
Apr 22nd 2005, 2:05 am
I am trying to get a rss feed with following code:


Set xmlHTTP = Server.CreateObject("Microsoft.XMLHTTP")
xmlHTTP.Open "GET",strXMLfile,false
xmlHTTP.SetRequestHeader "Content-type", "text/xml"
xmlHTTP.Send

strXML = xmlHTTP.ResponseText


As long as the server that provides the rss feed is running, then my script is fine but if rss feed server has a problem and doesn't respond, then I will get an error message

msxml3.dll error '800c0008' when script executes xmlHttp.Send , how can I check the statue of rss feed server, so if it is not ready then I won't execute the xmlHTTP.Send?

Thanks.

iShopHQ
Apr 22nd 2005, 12:01 pm
If xmlHTTP.status = 200 Then strXML = xmlHTTP.ResponseText

This checks to see if the GET returned a 200, which means the request has succeeded. To see a full list of potential response codes, check:

http://kbs.cs.tu-berlin.de/~jutta/ht/responses.html

gworld
Apr 22nd 2005, 12:16 pm
ishopHQ

Thank you. I will try it and thanks for the link also.