Answered by:
When timeout fire

Question
-
User30110692 posted
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?
Thanks
Friday, October 11, 2013 5:06 AM
Answers
-
User260886948 posted
Hi,
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:
http://msdn.microsoft.com/en-us/library/ms730059.aspx .|
Best Regards,
Amy Peng- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, October 14, 2013 5:28 AM
All replies
-
User-837620913 posted
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
Friday, October 11, 2013 5:30 AM -
User-488622176 posted
How are you hosting your service : IIS or Windows service? Do you need feedback (request-reply) or does fire & forget match with the requirements.
Friday, October 11, 2013 8:07 AM -
User30110692 posted
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.
Thanks
Friday, October 11, 2013 9:04 AM -
User-488622176 posted
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.
Monday, October 14, 2013 5:14 AM -
User260886948 posted
Hi,
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:
http://msdn.microsoft.com/en-us/library/ms730059.aspx .|
Best Regards,
Amy Peng- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, October 14, 2013 5:28 AM