What's the correct way to get the output of an asp page located on the same server?

<%

GetUrl "/route/to/abc/123/"

Function GetUrl(url)
    Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
    objXMLHTTP.open "GET", URL, false
    objXMLHTTP.send()
    If objXMLHTTP.Status = 200 Then
        Response.Write objXMLHTTP.ResponseText
    End if
    Set objXMLHTTP = Nothing
End Function

%>

results in this pesky error.

msxml3.dll error '80004005'
Unspecified error
/test.asp, line 7

switching up to a newer serverxmlhttp

set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")

reveals a different, more meaningful error:

msxml6.dll error '80072ee6'
System error: -2147012890.
/test.asp, line 8

which google happily found an reason to, which says "Don't use serverXmlHttp to connect to the same server. (https://support.microsoft.com/en-us/kb/316451) What do you use? The article didn't offer much.

Anyway cool, there's a proper reason for my error. But what DO you use to connect to the same server, under classic asp, to capture the output of pages? This article (https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/aa23d158-000a-4ba2-8fe8-99895854d7f0.mspx?mfr=true) mentions if I'm doing isolation mode, then the process runs seperate to the web server process and there I can't use SSI, I can't figure out how to enable it in the first place anyway. It sounds nasty anyway. SSI is critical in my app, so I can't consider it.

What am I left with (besides the obvious: ditch ASP)? spawn a wscript.shell command prompt and pull it from there, echoing back to stdout? bounce off another reflector server? Grr

1

There are 1 answers

1
Zam On BEST ANSWER

You cannot request web page from web site which are running under the same Application pool.

A finite number of worker threads (in the Inetinfo.exe or Dllhost.exe process) is available to execute ASP pages. If all of the ASP worker threads send HTTP requests back to the same Inetinfo.exe or Dllhost.exe process on the server from which the requests are sent, the Inetinfo.exe or Dllhost.exe process may deadlock or stop responding (hang), because the pool of worker threads to process the incoming requests will be exhausted. This is by design.

If a single recursive request causes IIS to deadlock, the typical cause is that ASP script debugging is enabled.

Solution: create new folder, put your script inside this folder. After that in IIS create new Application pool and also create new application for this folder.

How to create new application for some folder: enter image description here

Sample when folder assigned to new application pool: enter image description here

NOTE: Do not try 3rd part DLL's for download web page from the same application pool. Result will be the same. Tested with some free http component.