Razort4x
Razort4x

Reputation: 3406

How to call a wcf service periodically from ASP.NET?

First I am quite sorry that I did post a question in regard to this, but was unable to clear my view point, thanks everyone who answered that (Timdog, M.Babcock, David), but I think to really shed lights on the matter, it would be best to repost this with clear meaning.

So, I have this site heartpatients.com (not right now, say hypothetically), in the site I have option to let any user who visits the site, configure a time, say 6hrs, 12hrs, 1day or whatever, so that after the time they configured, a mail be dispatched reminding them to take their heart pills. I have a method in WCF service named SendMail, so as should be clear by now, I need to call that method for particular user at a particular time as configured by user, so how can I do it? Also please take into consideration that if user number increases, how should I manage all this? I mean say User A sets time 6hr while user B sets 1Day, so what I need is that after every 6hr user A sets the time, and after every 1day user B sets the time, this method be called and should dispatch mail to respective user.

I haven't designed the method yet, so if you want me to customize something in method I could do that too.

ps: I tried to delete my previous question but I couldn't.

Upvotes: 1

Views: 587

Answers (1)

John Saunders
John Saunders

Reputation: 161773

It is not recommended to use ASP.NET for anything other than web-based code. Your periodic function isn't based on a user at a browser making a request and getting a response.

Instead, you should either create a Windows Service for this function, or else create a Console application and schedule it using the Scheduled Tasks feature of Windows.

Upvotes: 4

Related Questions