Eric Bryan

Eric Bryan

  • NA
  • 18
  • 7.2k

Configure a timeout in web.config for a web service

Jun 20 2020 6:10 AM
Hello everybody,
I have a web service hosted in IIS 7.5.
The web service works fine.
I try to configure a timeout in the web.config, but I can't do it.
I tried in my web.config :
  1. <Configuration>  
  2. <system.web>  
  3. <compilation debug="false" targetFramework="4.8" />  
  4. <httpRuntime targetFramework="4.8" executionTimeout="10" /> <!-- 10 seconds -->  
  5. <sessionState timeout="2" /> <!-- 2 minutes -->  
  6. </system.web>  
  7. </Configuration>  
and in the web service controller :
  1. Thread.Sleep(180000) //3 minutes  
I thought the execution would stop after 10 seconds but instead it stops after 1 minute, whatever I put in the "executionTimeout" and "timeout" parameters.
I have searched in IIS but impossible to find what this minute corresponds to.
Does someone have an idea ?
Thanks a lot in advance.
Eric.

Answers (2)