creating xmlhttp object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    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


  • MSFT

    #2
    RE: creating xmlhttp object

    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."

    Comment

    • Bob Barrows

      #3
      Re: creating xmlhttp object

      manofsteele@311 .com wrote:[color=blue]
      > 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")[/color]

      On the server side, you should use ServerXMLHTTP:


      HTH,
      Bob Barrows



      Comment

      • Guest's Avatar

        #4
        Re: creating xmlhttp object

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

        "MSFT" <lukezhan@onlin e.microsoft.com > wrote in message
        news:Oq4YdCVaDH A.396@cpmsftngx a06.phx.gbl...[color=blue]
        > 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[/color]
        can[color=blue]
        > open IE and browse to "http://www.txdps.state .tx.us/mpch/sb1063.xml",[/color]
        would[color=blue]
        > 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[/color]
        to[color=blue]
        > 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."
        >[/color]


        Comment

        • Nikhil

          #5
          creating xmlhttp object

          Try using the winHTTP object

          Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

          us/winhttp/http/portal.asp?fram e=true
          [color=blue]
          >-----Original Message-----
          >Hi, i'm trying to run an .asp page to get an xml file off[/color]
          a server.[color=blue]
          >
          >I need to know what object to create. My page just runs[/color]
          till timeout...it[color=blue]
          >bombs on the httpxml.send command. This is the code I[/color]
          have:[color=blue]
          >
          >set httpxml = Server.CreateOb ject("Msxml2.XM LHTTP.3.0")
          >httpxml.open "GET", "http://www.txdps.state .tx.us/mpch/sb1[/color]
          063.xml", false[color=blue]
          >' 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[/color]
          = 0) then[color=blue]
          > Response.Write( xml.transformNo de(xsl))
          >else
          >'if an error occurs, report it
          > Response.Write "Error: " & objXSL.parseErr or.reason[/color]
          & "<br> URL:" &[color=blue]
          >objXSL.url
          >end if
          >
          >set httpxml=nothing
          >set xml=nothing
          >set xsl=nothing
          >
          >Do I need to install something???
          >
          >i am running xp pro
          >
          >
          >.
          >[/color]

          Comment

          • MSFT

            #6
            Re: creating xmlhttp object

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

            Comment

            Working...