Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i want to create web service that 'll be published on internet
but i need the code inside it to be executed every 5 minutes so i think to add timer to repeat code executing but how i add timer inside web service or there's another solution
need for help
thanks
Posted
Updated 10-Nov-11 17:51pm
v2
Comments
Tejas Vaishnav 10-Nov-11 23:53pm    
that's not good idea to execute a code of web service after every 5 mints..
one thing i don't understand that what you want to try to execute in web service...
its for use to provide service on the request not automatically...
Tejas Vaishnav 10-Nov-11 23:54pm    
you can go for windows service for continuous execution of your code....

Hi there,

The web service isn't a good place to do a timer. If there's work to do every 5 minutes, the web service is good to read the result or progress of that work, but not a good host for the work.

Your best bet is to go with a service (steeper learning curve) or a simple console app (easiest). The console app could be put into Windows Task Scheduler and called every x minutes to do its work.

The approach there would be that you would use a data store (such as SQL server) where you would put your results. The web service would read from those results.

Hope this helps you get moving in the right direction.

Cheers.
 
Share this answer
 
Comments
Tejas Vaishnav 10-Nov-11 23:53pm    
Nice...
so nice solution offered .thanks ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900