I have a WCF Service that does a job on a request from client. I need that WCF Service to do a preprocessing on regular intervals on a day before it can service the requests coming from client. How can i automate my wcf service so that it does the preprocessing on regular intervals?
+1
A:
(On the server hosting the WCF service) setup a scheduled task that invokes a program (e.g. a simple console app) which triggers the WCF service's preprocessing.
M4N
2010-08-29 14:59:27
+1
A:
As M4N suggests, the Windows task scheduler allows you to set up tasks that can be run via the command line.
Another solution is to have the task descriptions and scheduled times stored in database tables. Have your service, upon initialization, create a timer (System.Timers.Timer or System.Threading.Timer) that triggers a callback every 60 seconds. On this callback, perform any tasks that are due to be run.
Andrew Shepherd
2010-08-30 02:56:54