473,585 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CreateOb ject("Msxml2.XM LHTTP.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.respons eXML

'Load the XSL
set xsl = Server.CreateOb ject("Microsoft .XMLDOM")
xsl.async = false
xsl.load(Server .MapPath("txdot .xsl"))
if (objXSL.readySt ate = 4 AND objXSL.parseErr or.errorCode = 0) then
Response.Write( xml.transformNo de(xsl))
else
'if an error occurs, report it
Response.Write "Error: " & objXSL.parseErr or.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 9786
I tested your code till "set XML = httpxml.respons eXML" 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.CreateOb ject("Msxml2.XM LHTTP.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******@onlin e.microsoft.com > wrote in message
news:Oq******** *****@cpmsftngx a06.phx.gbl...
I tested your code till "set XML = httpxml.respons eXML" 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?fram e=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.CreateOb ject("Msxml2.XM LHTTP.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.respons eXML

'Load the XSL
set xsl = Server.CreateOb ject("Microsoft .XMLDOM")
xsl.async = false
xsl.load(Serve r.MapPath("txdo t.xsl"))
if (objXSL.readySt ate = 4 AND objXSL.parseErr or.errorCode = 0) then Response.Write( xml.transformNo de(xsl))
else
'if an error occurs, report it
Response.Write "Error: " & objXSL.parseErr or.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.CreateOb ject("Msxml2.XM LHTTP")
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
3250
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 properly. I was trying to use such code: <script lang="javascript"> function handleOnReadyStateChange() { if (this.readyState==4) {
3
1983
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 error and the error is System.Runtime.InteropServices.COMException(0xC00CE56E): System error:- 1072896658
5
10976
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 code. Also error comes only sometimes. var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); xmlhttp.Open("POST", "test.aspx?qsVar="+qsVar, false);...
7
2500
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: ---------------------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>
12
6384
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 XMLHTTP object, using the progids "Msxml2.XMLHTTP" and (if that fails) "Microsoft.XMLHTTP". If the latter fails I display the error. The error appearing...
6
10448
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 anything. I have searched through the Internet and seems like the reason it hangs the browser it's because XMLHTTP limits you to two concurrent...
1
4912
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, which is the file I am programmatically rewriting to elsewhere) gets changed. I am trying to use AJAX and JSON to do this. I have copied an example...
4
11418
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 XMLHTTP object. However, when the page requested through the XML object makes a <%Response.Redirect()%> call, a new session is created each...
2
3289
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 of AJAX. One thing I noticed was that the .htc code practically does the same thing AJAX does - with nice code that allows you to .value reference...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.