Joe
Joe

Reputation: 1055

Classic ASP routine calling a page on same server

I'm moving an old ASP application from a Windows Server 2012R2 to a new Windows Server 2016 Standard Edition: Old server had IIS 8, new server uses IIS 10

this application has some routines that makes an MSXML2.ServerXMLHTTP.6.0 call to a page hosted on the same server:

the problem is that this routine works on the old server, but does not work on the new server

I build this small routine to make the test

<%
  Dim xmlhttp
  Dim payload
  payload="OID="&Timer*100
  Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
  xmlhttp.setTimeouts 30,500,1000,1000
  xmlhttp.Open "GET", "http://sameserver.com/test.asp?"&payload , false
  On Error Resume Next
  xmlhttp.Send
  If Err.Number Then
    response.write "ERROR: Could Not Retrieve Remote Server <br>  Error Number: "&Err.Number&"<br>Error Description: "&Err.Description
    Err.Clear
  Else
    response.write = "OK: "&xmlhttp.ResponseText
  End If
  On Error Goto 0
  Set xmlhttp = nothing
%>

that works on the old server but on the new server returns

Error Number: -2147012894
Error Description: Operation Timeout

I thought there were some bad/missing settings on new server, perhaps in IIS Settings, but I also tried a very simple test in PHP, that works fine:

<?php
    $timer= new DateTime();
    $payload='OID='.$timer->format('Y-m-d%20H:i:s');
    $url='http://sameserver.com/test.asp?'.$payload;
    echo file_get_contents($url);
?>

Clearly I can change these routine and use PHP, but I'm afraid that this error could create also other, at present, undisclosed issues

Can suggest the possible reason, or, at least, which checks has to be made?

Thanks

Upvotes: 0

Views: 785

Answers (1)

Craig
Craig

Reputation: 3297

Your answer is here. Microsoft recommends not making ServerXMLHTTP to the same server. There are probably alternatives; it's hard to tell what you're trying to do from the code you posted.

Upvotes: 1

Related Questions