creating xmlhttp object

G

Guest

Hi, i'm trying to run an .asp page to get an xml file off a server.

I need to know what object to create. My page just runs till timeout...it
bombs on the httpxml.send command. This is the code I have:

set httpxml = Server.CreateObject("Msxml2.XMLHTTP.3.0")
httpxml.open "GET", "http://www.txdps.state.tx.us/mpch/sb1063.xml", false
' get the requested XML data from the remote location
' change the URL as per your feed.
httpxml.send

' save the XML in objXML as XML
set XML = httpxml.responseXML

'Load the XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("txdot.xsl"))
if (objXSL.readyState = 4 AND objXSL.parseError.errorCode = 0) then
Response.Write(xml.transformNode(xsl))
else
'if an error occurs, report it
Response.Write "Error: " & objXSL.parseError.reason & "<br> URL:" &
objXSL.url
end if

set httpxml=nothing
set xml=nothing
set xsl=nothing

Do I need to install something???

i am running xp pro
 
M

MSFT

I tested your code till "set XML = httpxml.responseXML" and it worked well
(a little slow). I haven't found the timeout. On the same computer, you can
open IE and browse to "http://www.txdps.state.tx.us/mpch/sb1063.xml", would
you get the XML file in IE?

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
B

Bob Barrows

Hi, i'm trying to run an .asp page to get an xml file off a server.

I need to know what object to create. My page just runs till
timeout...it bombs on the httpxml.send command. This is the code I
have:

set httpxml = Server.CreateObject("Msxml2.XMLHTTP.3.0")

On the server side, you should use ServerXMLHTTP:
http://www.aspfaq.com/show.asp?id=2173

HTH,
Bob Barrows
 
M

MSFT

There shouldn't be any problem with your code. Did you have any
proxy/gateway between your server and outer web site? you may try following
script on other computer to see if there is a difference:

dim httpxml

set httpxml = Server.CreateObject("Msxml2.XMLHTTP")
httpxml.open "GET", "http://www.txdps.state.tx.us/mpch/sb1063.xml", false
httpxml.send

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top