We have a WCF service hosted in IIS. I can see from log files that a client which sends a request that takes over 3 minutes to execute receives an HTTP 503 (Service unavailable) error.
How do I change the timeout? To test it worked I reduced the timeout to 3 seconds to make sure it actually timed out.
I’ve tried
<system.web>
<httpRuntime executionTimeout="3"/>
</system.web>
which seemed to do nothing.
I’ve also tried changing the binding to no avail.
<basicHttpBinding>
<binding name="basicHttp" receiveTimeout="00:00:03" sendTimeout="00:00:03" >
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
Note, I am trying to get the WCF service to return some sort of failure after a duration controlled by us. I’m not expecting the request that has taken longer than expected to terminate.
Any help most appreciated before I tear my hair out.
Just to clarify…
The service has been up and running for a few months. But when processing the occasional long running request, the client receives an HTTP 503 response after 3 minutes. In the background we can see that the request has been properly procesed but it has taken > 5 minutes. Obviously by this point it’s too late as the client has already received an error response.
Other requests are being processed as normal.
The load on the system at this point is very low. In fact, this is a test environment and transactions are one at a time with no overlaps.
I’m also quite certain that the bindings are connected to the endpoints. I’ve opened the config file in the WCF Config Editor and everything is linked up correctly.
Is it even possible to configure a time out at this point in WCF? In way I would understand if not, but then why is an HTTP 503 error being returned?
All we would really like to do is control the length of time before the 503 response is returned.
After much experimentation in IIS and a test WCF service, I was unable to reproduce the problem – even on the same server. The issue is only seen by another group within the company.
The only way I could force an HTTP 503 error was to take the app pool offline, but this predictably caused errors to be returned immediately when a request came in.
Further investigation showed that the HTML associated with the 503 response coming from IIS was different from that being returned to the client.
Admittedly this is as yet unproven, but we have concluded that the issue is caused by some network component between the client and the server.There was indeed a proxy in between that was returning the timeout.