C # webservice timeout tone; result: C # webservice service call timeout

When you call C # WebService service, error, The operation has timed out, which means "The operation timed out."

C # webservice service call timeout

Method / Step

  1. First modify the server configuration

    WebService service for the site where the service side, it provides a service, open the web.config this site, add the following configuration:

     

        <httpRuntime  executionTimeout="300000" />

    <compilation defaultLanguage="c#" debug="false">

     

    executionTimeout = "300000" units "ms", the configuration here is 5 minutes.

    debug = "false" to disable the debugging.

     

    If the web.config already has two configurations, change it on the line. If not, add up, complete structural sequence is as follows:

    <configuration>

      <system.web> 

            <httpRuntime  executionTimeout="300000" />

            <compilation defaultLanguage="c#" debug="false">

          </compilation>

      </system.web>

    </configuration>

  2. 2

     Modify the caller client configuration

    YourService. YourService model = new YourService. YourService ();

    model.Timeout = 300000; // milliseconds, set time, or time overrun

     

    Here to serve as a model to set the timeout Timeout 300,000 milliseconds.

C # webservice service call timeout

Method / Step

  1. First modify the server configuration

    WebService service for the site where the service side, it provides a service, open the web.config this site, add the following configuration:

     

        <httpRuntime  executionTimeout="300000" />

    <compilation defaultLanguage="c#" debug="false">

     

    executionTimeout = "300000" units "ms", the configuration here is 5 minutes.

    debug = "false" to disable the debugging.

     

    If the web.config already has two configurations, change it on the line. If not, add up, complete structural sequence is as follows:

    <configuration>

      <system.web> 

            <httpRuntime  executionTimeout="300000" />

            <compilation defaultLanguage="c#" debug="false">

          </compilation>

      </system.web>

    </configuration>

  2. 2

     Modify the caller client configuration

    YourService. YourService model = new YourService. YourService ();

    model.Timeout = 300000; // milliseconds, set time, or time overrun

     

    Here to serve as a model to set the timeout Timeout 300,000 milliseconds.

Guess you like

Origin www.cnblogs.com/turnip/p/12460562.html