473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

creating xmlhttp object

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
Jul 19 '05 #1
5 9777
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/se...s/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."

Jul 19 '05 #2
ma*********@311.com wrote:
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

Jul 19 '05 #3
Yes, I view the xml file in IE, so I shouldn't have a connectivity problem.

"MSFT" <lu******@online.microsoft.com> wrote in message
news:Oq*************@cpmsftngxa06.phx.gbl...
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/se...s/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."

Jul 19 '05 #4
Try using the winHTTP object

http://msdn.microsoft.com/library/en-
us/winhttp/http/portal.asp?frame=true
-----Original Message-----
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...itbombs 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/sb1 063.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
.

Jul 19 '05 #5
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.)

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Krzysztof Kubiak | last post by:
I'm trying to make use of XMLHTTP object, but I've come across a problem. It seems that there is no way to create dynamic array of such XMLHTTP objects (to make several requests) and handle them...
3
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system...
5
by: RK | last post by:
I am getting the "HTTP /1.1 405 - method not allowed" error when I am sending XML string over Msxml2.XMLHTTP object. I am sending data in POST, also passing querystring variable and here is the...
7
by: Fabri | last post by:
I'm trying to develop a way to include static files in htm pages with javascript. I'm trying to use XMLHTTP object this way: ...
12
by: steveH | last post by:
Hi, I'm trying to solve a problem for a user which I can neither reproduce or explain. Here goes in the hope that someone else may have experienced the same. I make two attempts to create the...
6
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing...
1
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php,...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
2
by: Jay | last post by:
Getting into AJAX using the XMLHttp object and am really liking it. We are in the process of upgrading our existing behavior calls (webservice.htc) to the more 'supported', as they say, concept...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.