Windows Service Functionality using IIS/Application Servers

N

nkunapa

Hi:
I am looking for any ideas/comments/suggestions on how a Windows
Service kind of functionality can be acheived from a web application
which which will run under IIS or for that matter any application
server say Tomcat. I have a Windows service which should run every half
hour and call four different methods in a Web Service in serial mode.
The methods will have to wait for the previous one to finish and if the
previous one is a really long process (say 15 minutes) the subsequent
method will not get invoked till the previous one gets finished. That
leaves us to either implement a Windows Service for each method (which
might be tough maintaining services as the number of methods increase)
or a MultiThreaded application so that each method will run in Parallel
in its own thread in the same service.

But, what we are particularly looking for is " Do we really need a
Windows Service to achieve this task?". Can it not be an application
that will start and run along with an Application Server since ASP.Net
has it own Timers Class and all of these scheduling activities can be
achieved using that? I am looking for any tips/suggestions or even if
this is possible at all?

Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

I don't understand where ASP.NET comes into this. You basically have a
task that needs to run every 1/2 hour, right? Just write it as an EXE and
then set it up as a scheduled task which runs every 1/2 hour, and that's it.

Whether or not you make the calls to the four web services in serial or
parallel is up to you.

Hope this helps.
 
N

nkunapa

Thanks. I just gave ASP.net as an example. Well, I would say a
scheduled task in also one of the options but it might only add
additional code to keep track if the previous scheduled task has really
completed as the task that is supposed the run at the next half hour
cycle is supposed to run only if the previous task has completed. I am
not if this functionality can be achieved by creating an EXE and
setting it up as scheduled task unlike a windows service. I mean one of
the four methods may be still running while three others might have
completed. Then the second half hour cycle should only process the
three that were completed in the first cycle.

The basic question I am asking is "Is is possible to set up an
application to attach itself to an Application Severs
(IIS/Tomcat/...etc) and run as soon the application server starts?".

Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Unless the server has a hook to allow this, no, it is not possible,
there is not a general mechanism to allow you to do this.

However, I don't see how this is related to you having a task running
every half hour. I mean, if you set it up as a scheduled task, you dont
need another service to tell you to start, the scheduled task service will
just handle it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top