How to increase the timeout period of web service in asp.net?

前端 未结 3 398
萌比男神i
萌比男神i 2021-02-03 21:58

I\'ve created one web service which is of asmx type. And I\'m using my web service in the .net windows application.

Web method from the web service receives byte array

3条回答
  •  情话喂你
    2021-02-03 22:27

    1 - You can set a timeout in your application :

    var client = new YourServiceReference.YourServiceClass();
    client.Timeout = 60; // or -1 for infinite
    

    It is in milliseconds.

    2 - Also you can increase timeout value in httpruntime tag in web/app.config :

    
         
              
              ...
         
    
    

    For ASP.NET applications, the Timeout property value should always be less than the executionTimeout attribute of the httpRuntime element in Machine.config. The default value of executionTimeout is 90 seconds. This property determines the time ASP.NET continues to process the request before it returns a timed out error. The value of executionTimeout should be the proxy Timeout, plus processing time for the page, plus buffer time for queues. -- Source

提交回复
热议问题