Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlhttp question

Status
Not open for further replies.

lytus

MIS
Jun 17, 2004
48
US
Hi all,
I am writing a script that pulls back the xml.status of a web site. I was originally using this:
Set xml=CreateObject ("MSXML2.XMLHTTP.3.0")
but I realized it caches the sites. Once the xml.status = 200 it would come back as 200 every time. Then I found a site that said if you are having this problem use this:
Set xml=CreateObject("Msxml2.SERVERXMLHTTP")
That has gotten rid of my caching problem, but now some sites will not return a 200 even if it is up. I get a 401 for some and a 200 for others, I check the site, they are up. Does anyone know why this is happening and have a fix for this, there seems to be 100 different versions of these things out there so maybe one of you knows of one that will not cache, but will work on all types of sites.

I have tried downloading some service packs, but that doesn't seem to help either.

Thanks in advance for your help.
 
Ok, all of this works, if I use the
msxml2.xmlhttp.3.0 I get a 200 every time, the caching problem. If I use the:
msxml2.serverxmlhttp.4.0 then it does not work for most sites.

Any ideas?

'Set xml=CreateObject("Msxml2.SERVERXMLHTTP")
'Set xml=CreateObject("Msxml2.SERVERXMLHTTP.4.0")
Set xml=CreateObject ("MSXML2.XMLHTTP.3.0")


'Opens the connection to the remote server
xml.Open "GET", Svc.GetStrParameter("Web_site", numSiteCounter), False
strEventKey = Svc.GetStrParameter("Web_site", numSiteCounter)


xml.Send
sStatus = xml.status

if sStatus <> 200 then
'Send event to webmasters

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top