using xmlhttp in ASP

using xmlhttp in ASP

am 29.05.2007 19:49:00 von 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("")
next
xml_http.abort()




%>

Re: using xmlhttp in ASP

am 29.05.2007 20:06:50 von reb01501

Zagor wrote:
> 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-conte nts-of-a-remote-web-page.html
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.