0

I'm getting an error when calling a method of an ASP.NET MVC controller from Classic ASP using XMLHTTPRequest.

msxml3.dll error '80072ee2'
The operation timed out
/createpaymentlink_ajax.asp, line 198

As I debugged the whole code the method calling is going to an ASP.NET MVC controller, but it's taking time to get output from database and before getting that response, I am facing this timeout issue in classic ASP.

function getHTML (strUrl)
      Dim xmlHttp 
      Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP.3.0")
        xmlHttp.SetTimeouts 600000, 600000, 15000, 15000
        xmlHttp.Open "GET", strUrl, True
        xmlHttp.SetRequestHeader "Content-Type", "application/xml; charset=UTF-8"
        xmlHttp.SetRequestHeader "Accept", "application/xml; charset=UTF-8"
        xmlHttp.Send          
        If xmlHttp.waitForResponse(90) Then 
            http_response = xmlHttp.responseText 
        End If      
        getHTML = "COMPLETED"
        set xmlHttp = Nothing       
    end function

I'm currently using this code to call method from classic ASP. I've also tried to added SetTimouts and waitForResponse as well.

Can anyone please help me ?

  • See following : https://stackoverflow.com/questions/579523/how-do-i-set-the-request-timeout-for-one-controller-action-in-an-asp-net-mvc-app#:~:text=You%20can%20set%20this%20programmatically%20in%20the%20controller%3A-,the%20default%20110%20seconds%20%28what%20an%20odd%20default%3F%29 – jdweng Jul 09 '22 at 14:55
  • @jdweng, I Tried, But Not working. –  Jul 09 '22 at 15:53
  • Does this answer your question? [How do I set the request timeout for one controller action in an asp.net mvc application](https://stackoverflow.com/questions/579523/how-do-i-set-the-request-timeout-for-one-controller-action-in-an-asp-net-mvc-app) – user692942 Jul 09 '22 at 15:59
  • Looks like a timeout was added 18 days ago to the api. See : https://github.com/cashfree/cashfree-pg-sdk-nodejs#readme – jdweng Jul 09 '22 at 18:27
  • @jdweng there is nothing in the question to suggest what they are using, what makes you think its the CashFree API? They said they are consuming an ASP.Net MVC app not a NodeJS one. – user692942 Jul 11 '22 at 06:46
  • 1
    Right @user692942, this is not helpful –  Jul 11 '22 at 07:36
  • @ArpitPatel : The exception says "createpaymentlink_ajax.asp" – jdweng Jul 11 '22 at 08:45
  • Looks like the server can't route to that IP / domain. Can you remote into the box and test if the URL loads in a browser from the machine? Otherwise try a different URL and see if that particular server is blocking requests for some reason from your IP – silver Jul 12 '22 at 01:53
  • @silver, Routing is working fine. Its calling perfectly. But, inside that request there is one Database Call which is taking time due to that its not responding in time. –  Jul 12 '22 at 04:30
  • @jdweng, Its only page name. There were no such Payment flow. Its only generating Links and URLs. –  Jul 12 '22 at 04:31
  • Do other connections to database work? We need to find out if the error is due to the connection to the database failing or just the time for query to complete. You may need to increase timeouts to database. – jdweng Jul 12 '22 at 08:44
  • @jdweng, Its Database, That's taking time to execute Store Procedure. –  Jul 13 '22 at 05:22
  • You need to modify the server code and increate the timeout for query to database. Normally the default time limit is 30 seconds. – jdweng Jul 13 '22 at 06:21
  • You can set the timeout using a different method: https://stackoverflow.com/a/14055875/1862388 – silver Jul 13 '22 at 09:20
  • @silver, This is what i already did. but, its not working –  Jul 13 '22 at 10:55
  • Thank you all for your suggestions and help –  Jul 13 '22 at 10:55
  • 1
    I also facing same issue as well as i tried all the solution but its not work for me as well. –  Jul 18 '22 at 05:57

0 Answers0