Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF service timeout

Tags:

wcf

timeout

Is there a way to set a tiemout on the service side so that the request stops processing if it exceeds the timeout? I know I can time the request out on the client side, but that doesn't stop the processing of the request on the server.

I've tried adding the following binding:

<basicHttpBinding>
    <binding name="timeout" receiveTimeout="00:01:00" closeTimeout="00:01:00" openTimeout="00:01:00" sendTimeout="00:01:00" />
</basicHttpBinding>

I've also tried adding the following in the system.web node (separately and together with the above):

<httpRuntime executionTimeout="60" /> <!-- timeout after 60 seconds -->
like image 261
zimdanen Avatar asked Mar 05 '12 14:03

zimdanen


1 Answers

There is no built in (out of the box) way to do this. All of the timeouts that you can set are related to transport settings. In short words, you have to do that yourself.

Please also see this answer about limiting WCF execution time.

like image 171
CSharpenter Avatar answered Nov 15 '22 09:11

CSharpenter