Last post Oct 14, 2013 05:28 AM by Amy Peng - MSFT
Oct 11, 2013 05:06 AM|xtinction84|LINK
I have a process that takes over 1 hour to complete the process.
The thing is... the service timeout fire, but the process continues.. the problem is... how can i control the process. Because the service will fire after 10minutes again, And I don't want the service on, if the process before is not complete?
Oct 11, 2013 05:30 AM|DarrellNorton|LINK
You really need to setup your service to know that it is going to be a long-running task and allow clients to "poll" it to ask how far along it is. You should not keep a connection open for over an hour.
Here are a few examples of setting up WCF for long running processes with polling:
Or this one that uses Workflow: http://visualstudiomagazine.com/articles/2011/08/01/pcnet_long-running-services.aspx
Oct 11, 2013 08:07 AM|Illeris|LINK
How are you hosting your service : IIS or Windows service? Do you need feedback (request-reply) or does fire & forget match with the requirements.
Oct 11, 2013 09:04 AM|xtinction84|LINK
I 'm hosting the service in IIS. The thing is I call the service (console application) at 13.00pm and can take 15 minutes or an hour to be completed. But at 13.30 I need to call again the service, but will depend if the call before if finalized.
Oct 14, 2013 05:14 AM|Illeris|LINK
You could call the service asynchronously. This enables you to return something with finished (even after a long period of time). If you rerun at 13h30, you can check of the previous call has finished. If not, you wait.
Oct 14, 2013 05:28 AM|Amy Peng - MSFT|LINK
Since your process takes over 1 hour to complete the process, so first please increase the executionTimeout in
web.config to support the longer execution time.
The default executionTimeout is 90 seconds for .NET Framework 1.0 and 1.1, 110 seconds otherwise.
And the executionTimeout specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down:
<httpRuntime executionTimeout = "5000" />
Then maybe you can try to call WCF Service Asynchronously, then you will know when the process will complete.
For more information, please try to refer to:
#How to: Call WCF Service Operations Asynchronously: