Home All Groups Group Topic Archive Search About

XMLHTTP no longer works after updates

Author
7 Apr 2006 5:49 PM
Lewis
We recently installed some updates on our Windows 2000 server machine.  It is
running IIS 5.0.  Ever since we did, one of our web pages no longer works. 
Here is a snippet of the code that no longer works:

Function GetHTML(strURL)
  Dim objXMLHTTP, strReturn
  Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")

  objXMLHTTP.Open "GET", strURL, False
  objXMLHTTP.Send ""

  strReturn = objXMLHTTP.responseBody
  Set objXMLHTTP = Nothing

  GetHTML = strReturn
End Function

function PullChart(indos)
Response.Clear
Response.Buffer = true
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Disposition", "attachment;filename=" & indos &
".pdf"
Response.BinaryWrite GetHTML("ftp://username:password@192.168.1.19/" & indos
& ".pdf")


end function

Did something change recently that would affect the Microsoft.XMLHTTP
object?  When we try to pull the PDF file off of our FTP server, the code
crashes.

Please help!!!

Thanks!

Lewis.

Author
11 Apr 2006 1:55 PM
Daniel Crichton
Lewis wrote  on Fri, 7 Apr 2006 10:49:02 -0700:

Show quoteHide quote
> We recently installed some updates on our Windows 2000 server machine.  It
> is running IIS 5.0.  Ever since we did, one of our web pages no longer
> works.  Here is a snippet of the code that no longer works:
>
> Function GetHTML(strURL)
>   Dim objXMLHTTP, strReturn
>   Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
>
>   objXMLHTTP.Open "GET", strURL, False
>   objXMLHTTP.Send ""
>
>   strReturn = objXMLHTTP.responseBody
>   Set objXMLHTTP = Nothing
>
>   GetHTML = strReturn
> End Function
>
> function PullChart(indos)
> Response.Clear
> Response.Buffer = true
> Response.ContentType = "application/pdf"
> Response.AddHeader "Content-Disposition", "attachment;filename=" & indos &
> ".pdf"
> Response.BinaryWrite GetHTML("ftp://username:password@192.168.1.19/" &
> indos & ".pdf")
>
> end function
>
> Did something change recently that would affect the Microsoft.XMLHTTP
> object?  When we try to pull the PDF file off of our FTP server, the code
> crashes.
>
> Please help!!!
>
> Thanks!
>
> Lewis.

I've read plenty about XMLHTTP crashing when it can't connect to the
server - check to make sure the server you're contacting is accessible from
the IIS machine.

I'd also recommend you look at using ServerXMLHTTP instead:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q290761

XMLHTTP is designed for client-side use, and may cause problems in a
server-side environment such as ASP.

Dan