Reputation: 343
I would like to automate a web method inside a web service that should run on a periodic basis. I also need to pass some arguments to it at runtime.
Some details:
What would be the best approach to accomplish this? If you, based on your experience, have any suggestions on a better way to perform this process, they will be greatly appreciated.
Any tips or links will be more than welcome.
Upvotes: 0
Views: 481
Reputation: 42003
Use a Windows Service. Web Services are not designed for this task!
Upvotes: 0
Reputation: 11763
Sounds like you'll need to either set timers (so look ahead for the next checkup, and set them), or once every x amount of time, see if it needs to be done.
I'd probably use a background thread with a timer and sleep in between.
Having said that, I'm not sure this question will get much love, as it's not the best "fit wise".
Upvotes: 1
Reputation: 6222
I'd recommend using IIS7.5 AutoStart http://msdn.microsoft.com/en-us/library/ee677260(v=azure.10).aspx site which you then use to Poll the SQL Server database. This AutoStart app (the web equivalent of a Windows Service) can then call your designated URL when the schedule matches its log and the current time.
Upvotes: 1