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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLHTTP works in VB but not ASP

Status
Not open for further replies.

kav123

Programmer
Joined
Jan 12, 2005
Messages
210
Location
GB
I am using XMLHTTP object of Microsoft, to access a web server, an XML feed basically, and display it on my website. It doesnt seem to be working in ASP, however, the same thing seems to be working in VB though!! Can't understand why.

The code i am using in ASP is,
Set xmlURL=Server.CreateObject("Microsoft.XMLHTTP")

xmlURL.open "Get","xmlURL.SetRequestHeader "Content-type",Text/xml
xmlURL.send

Set xmlObj=xmlURL.responseXML

The same thing, works absolutely fine in VB syntax. I googled the web to sort the error, and found, out thay i had to register some dlls. I did that, and restarted my mac, however, not much of a use.
In VB i declare the HTTP object as MSXML2.XMLHTTP. I tried the same thing in ASP as well i.e. Server.Create(MSXML2.XMLHTTP), but no use.

Any one has a clue why??
 
There is more than one version of the XMLHTTP object.

The original one was not made to be used on the server. You can use "Microsoft.XMLHTTP" in client-side script but don't use it in your server-side ASP.

The newer versions of the microsoft xml parser have a separate object that is safe to use on the server.

Try this: Set xmlURL=Server.CreateObject(""MSXML2.ServerXMLHTTP")

Or this: Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
 
I tried MSXML2.ServerXMLHTTP on server side,however, it gave me an error. The error was: msxml3.dll(0X80072EE7) The server name or address cannot be found.

Actually i am trying to get an XML feed from a webserver. And my webserver is behind a firewall and has to pass the proxy servers. Has it got anything to do with that?? I mean the source and target webservers being behind firewalls/proxy servers??

 
Where do i get this utility from?? Have searched all over the net, i have also updated my Win2K machine with Service pack4
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top