creating xmlhttp object

Discussion in 'ASP General' started by Guest, Aug 22, 2003.

  1. Guest

    Guest Guest

    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
    Guest, Aug 22, 2003
    #1
    1. Advertising

  2. Guest

    MSFT Guest

    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/security_bulletins/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."
    MSFT, Aug 23, 2003
    #2
    1. Advertising

  3. Guest

    Bob Barrows Guest

    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
    Bob Barrows, Aug 23, 2003
    #3
  4. Guest

    Guest Guest

    Yes, I view the xml file in IE, so I shouldn't have a connectivity problem.

    "MSFT" <> wrote in message
    news:...
    > 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/security_bulletins/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."
    >
    Guest, Aug 25, 2003
    #4
  5. Guest

    Nikhil Guest

    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...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/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
    >
    >
    >.
    >
    Nikhil, Aug 25, 2003
    #5
  6. Guest

    MSFT Guest

    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.)
    MSFT, Aug 26, 2003
    #6
    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. CsaaGuy
    Replies:
    3
    Views:
    1,290
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 28, 2006
  2. Replies:
    5
    Views:
    1,223
    Martin Honnen
    Sep 28, 2005
  3. Glenn Venzke
    Replies:
    0
    Views:
    110
    Glenn Venzke
    Aug 12, 2005
  4. vunet
    Replies:
    3
    Views:
    212
    p byers
    Jun 11, 2008
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

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

Share This Page