Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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 10-Nov-11 9:53am
Edited 10-Nov-11 18:51pm
v2
Comments
Tejas_Vaishnav at 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 at 10-Nov-11 23:54pm
   
you can go for windows service for continuous execution of your code....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Tejas_Vaishnav at 10-Nov-11 23:53pm
   
Nice...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

so nice solution offered .thanks ...
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 16 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100