WCF service timeout

I have a WCF service method that runs for more than two hours (multiple reports run). How can I make sure that it does not turn off, regardless of the time it takes? I think there are many timeout settings in the WCF configuration, I'm not sure which one is right for me. for ASMX web services it was possible to specify an infinite timeout setting, is there a similar one for WCF ?. I also need to change any IIS settings for this (WCF is hosted in IIS), for example, workflow processing, idle timeouts, etc.?

+4
source share
3 answers

Do you consider using callbacks? Your client sends a request and then waits for a notification from the server, when will this be done? This will probably require a change in the client, but in this way your service can break the chain and tell the client when the report is completed.

help: http://idunno.org/archive/2008/05/29/wcf-callbacks-a-beginners-guide.aspx

WCF timeouts: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/

You should also consider client side timeouts. (binding.OpenTimeout, ReceiveTimeout, CloseTimeout, etc.)

Another option is to place WCF in a Windows service, which will simplify your situation as it removes IIS from the equation:

http://msdn.microsoft.com/en-us/library/ms733069.aspx

Or how about using a one-way WCF call? Thus, the call will be returned to the client as soon as possible after sending the request.

Need to try fire and forget the asynchronous call to WCF service

+5
source

This is an abuse of web services. Do not do that.

Instead, the web service launches a lengthy operation running in a separate process. If customers need to know when reports will be executed, then a โ€œseparate processโ€ tracks the creation of the report and whether it should take into account when the reports are completed. A customer can call a web service to check this status.

You really do not want to depend on an open HTTP connection from time to time. This is a network. Things happen on the net. Bad things.

+8
source

Consider creating a WCF workflow service (using WF). They are specially designed to handle lengthy processes, especially if you use persistence.

+1
source

Source: https://habr.com/ru/post/1334393/


All Articles