using xmlhttp in ASP

Z

Zagor

I have the code below and in a random fashion it is responding extremely
slowly. On in 3-4 times it takes ages to do the job... Any help will be much
appreciated...
It is the line: xml_http.Send("") that gets stuck. I am on IIS 6 on Windows
Server 2003 Web Edition.

<%
pcode = request.querystring("postcode")

source2 = "http://3rdparty.com/addresslist.pce?postcode=" & pcode

Dim xml_http
Set xml_http = Server.CreateObject("Microsoft.XMLHTTP")
xml_http.Open "GET", source2, false

set source = Server.CreateObject("Microsoft.XMLDOM")
set sourceSorted = Server.CreateObject("Microsoft.XMLDOM")
set styleDoc = Server.CreateObject("Microsoft.XMLDOM")

source.async = true
sourceSorted.async = true
styleDoc.async = true


xml_http.Send("")

source.loadxml(xml_http.ResponseText)

styleDoc.load(Server.MapPath("/postcode/ReDoXmlSorted.xsl"))
source.transformNodeToObject styleDoc, sourceSorted

for each obj in sourceSorted.getElementsByTagName("Address")
'for each obj2 in sourceSorted.getElementsByTagName("PostKey")
' postKey = obj2.text
'next
set pKEy = obj.nextSibling
response.write("<option value='" & pKEy.text & "'>" & replace(obj.text,
pcode, "") & "</option>")
next
xml_http.abort()




%>
 
B

Bob Barrows [MVP]

Zagor said:
I have the code below and in a random fashion it is responding
extremely slowly. On in 3-4 times it takes ages to do the job... Any
help will be much appreciated...
It is the line: xml_http.Send("") that gets stuck. I am on IIS 6 on
Windows Server 2003 Web Edition.

<%
pcode = request.querystring("postcode")

source2 = "http://3rdparty.com/addresslist.pce?postcode=" & pcode

Dim xml_http
Set xml_http = Server.CreateObject("Microsoft.XMLHTTP")

Don't use XMLHTTP in server-side code. Instead use

Set xml_http = Server.CreateObject("Microsoft.ServerXMLHTTP")

http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-remote-web-page.html
 

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

Similar Threads

asp and rss feeds 4
Displaying XML in ASP 6
Don't understand flow using xmlhttp 6
Dynamic page updates using XMLHTTP 6
Help with SQL Queries in ASP 0
XMLHTTP POST DATA HELP ! 2
XML + ASP 7
XML and ASP 1

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top