using xmlhttp in ASP

Discussion in 'ASP General' started by Zagor, May 29, 2007.

  1. Zagor

    Zagor Guest

    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()




    %>
     
    Zagor, May 29, 2007
    #1
    1. Advertising

  2. 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-contents-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.
     
    Bob Barrows [MVP], May 29, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo

    Re: Classic ASP to ASP.Net XMLHTTP

    S. Justin Gengo, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    538
    S. Justin Gengo
    Aug 27, 2003
  2. Raúl Martín
    Replies:
    1
    Views:
    11,032
    Natty Gur
    May 13, 2004
  3. =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==

    Dynamic page updates using XMLHTTP

    =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==, Aug 7, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    460
    =?Utf-8?B?TGFiaGVzaCBTaHJpbWFsaSAtIEJhbmdhbG9yZQ==
    Aug 8, 2007
  4. Shannon
    Replies:
    7
    Views:
    336
    Bob Barrows
    Sep 29, 2003
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    436
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page