By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,315 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,315 IT Pros & Developers. It's quick & easy.

Implementing scheduler in web service

P: n/a
Yi
Hi, I am implementing a scheduler that will fire a command every 15 or
30 minutes. I would like to use web service interface to control the
timer (start, stop, etc). I think a workable solution is to implement
the timer in a Windows Service and use the web service to minotor and
control the windows service, but I don't like the "web service +
windows service" solution.

It would be better if everything is in the web service package. The
goal is taht when a "StartScheduler" web method is invoked, a timing
logic starts to run on the server and call a set of commands every 15
minutes, and a "StopScheduler" web method is called the timer is
stoped.

I tried to use a System.Timers.Timer object in the web service class
as shown in the following but it doesn't work. I tried to store the
timer in a session object but it still doesn't work. Any suggestions
on how to implement this? Thank you very much!

-Yi
---
[WebMethod]
public void StartScheduler()
{
timer = new System.TImers.Timer();
timer.enable();
timer.start();
}

[WebMethod]
public void StopScheduler()
{
timer.stop();
}
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Yi,

I think there is no "good" solution for your problem using
a webservice only - webservices are not designed for such
purpose at all!

Maybe you have the possibility to access any scheduling-
components - but what are your concerns regarding the
windowsservice AND webservice solution?

Regards

Tom
-----Original Message-----
Hi, I am implementing a scheduler that will fire a command every 15 or30 minutes. I would like to use web service interface to control thetimer (start, stop, etc). I think a workable solution is to implementthe timer in a Windows Service and use the web service to minotor andcontrol the windows service, but I don't like the "web service +windows service" solution.

It would be better if everything is in the web service package. Thegoal is taht when a "StartScheduler" web method is invoked, a timinglogic starts to run on the server and call a set of commands every 15minutes, and a "StopScheduler" web method is called the timer isstoped.

I tried to use a System.Timers.Timer object in the web service classas shown in the following but it doesn't work. I tried to store thetimer in a session object but it still doesn't work. Any suggestionson how to implement this? Thank you very much!

-Yi
---
[WebMethod]
public void StartScheduler()
{
timer = new System.TImers.Timer();
timer.enable();
timer.start();
}

[WebMethod]
public void StopScheduler()
{
timer.stop();
}
.

Nov 21 '05 #2

P: n/a
Hi,

Create a windows service which does the scheduler job to fire some command
every 15/30 minutes.

Create a webservice as a monitoring/controlling service for the windows
service.

You can use some registry entry/xml file/database table to share the
information between the webservice and the windows service.

Regards,
R.Balaji
"Yi" <hu********@hotmail.com> wrote in message
news:be**************************@posting.google.c om...
Hi, I am implementing a scheduler that will fire a command every 15 or
30 minutes. I would like to use web service interface to control the
timer (start, stop, etc). I think a workable solution is to implement
the timer in a Windows Service and use the web service to minotor and
control the windows service, but I don't like the "web service +
windows service" solution.

It would be better if everything is in the web service package. The
goal is taht when a "StartScheduler" web method is invoked, a timing
logic starts to run on the server and call a set of commands every 15
minutes, and a "StopScheduler" web method is called the timer is
stoped.

I tried to use a System.Timers.Timer object in the web service class
as shown in the following but it doesn't work. I tried to store the
timer in a session object but it still doesn't work. Any suggestions
on how to implement this? Thank you very much!

-Yi
---
[WebMethod]
public void StartScheduler()
{
timer = new System.TImers.Timer();
timer.enable();
timer.start();
}

[WebMethod]
public void StopScheduler()
{
timer.stop();
}

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.