Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is it possible to schedule a web service?

Reply
Thread Tools

Is it possible to schedule a web service?

 
 
antonyliu2002@yahoo.com
Guest
Posts: n/a
 
      07-24-2007
I have a web service, which needs to run at regular intervals (e.g.,
once every 2 hours) to create some PDF files for users to download.

I can certainly create a web application which lets user click a
button and generates the PDF file.

But since the PDF files are gonna be the same for all users, so, it
does not make sense to waste the server resources.

Is it possible to schedule a web service to run at regular
intervals?

I do not want to use the Windows Task Scheduler, part of the reason is
that we do not have full access to our clients' Windows system, and
it's cumbersome to get them involved in setting up the task
scheduler. So, I would like to do this completely within the IIS
context.

I googled a little, but could not find anything helpful.

Any idea? Thanks.

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      07-24-2007
You either have to use a scheduler or set up a service on the box that runs
on a timer. You might be able to kludge this with an HTTP Handler, but I am
not sure I would head down that path.

One thing to consider, as a poor man's method, is to have a "time" set into
application that increments by two hours each time it is hit. Then,
automatically update the files when a user hits the site and the "time" has
timed out.

Or, you could make teh PDF request through a page and refresh based on a
"timer" value. This way, you are only updating when people are requesting
the file, but you are updating all PDFs from a single page or HTTP Handler.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I have a web service, which needs to run at regular intervals (e.g.,
> once every 2 hours) to create some PDF files for users to download.
>
> I can certainly create a web application which lets user click a
> button and generates the PDF file.
>
> But since the PDF files are gonna be the same for all users, so, it
> does not make sense to waste the server resources.
>
> Is it possible to schedule a web service to run at regular
> intervals?
>
> I do not want to use the Windows Task Scheduler, part of the reason is
> that we do not have full access to our clients' Windows system, and
> it's cumbersome to get them involved in setting up the task
> scheduler. So, I would like to do this completely within the IIS
> context.
>
> I googled a little, but could not find anything helpful.
>
> Any idea? Thanks.
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
Guest
Posts: n/a
 
      07-24-2007
Anthony,

Web Service similar to a Web Application does not run by itself -
somebody/something has to trigger it. In your particular case, you may not
necessarily want to run the service as a separate process - you can check on
every (user) call whether the required file is already created and stored (in
the file system or ASP cache) and then either create one or retrieve it from
the storage.

"(E-Mail Removed)" wrote:

> I have a web service, which needs to run at regular intervals (e.g.,
> once every 2 hours) to create some PDF files for users to download.
>
> I can certainly create a web application which lets user click a
> button and generates the PDF file.
>
> But since the PDF files are gonna be the same for all users, so, it
> does not make sense to waste the server resources.
>
> Is it possible to schedule a web service to run at regular
> intervals?
>
> I do not want to use the Windows Task Scheduler, part of the reason is
> that we do not have full access to our clients' Windows system, and
> it's cumbersome to get them involved in setting up the task
> scheduler. So, I would like to do this completely within the IIS
> context.
>
> I googled a little, but could not find anything helpful.
>
> Any idea? Thanks.
>
>

 
Reply With Quote
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      07-24-2007
Create small console exe that consumes the webservice and schedule it using
windows scheduler.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I have a web service, which needs to run at regular intervals (e.g.,
> once every 2 hours) to create some PDF files for users to download.
>
> I can certainly create a web application which lets user click a
> button and generates the PDF file.
>
> But since the PDF files are gonna be the same for all users, so, it
> does not make sense to waste the server resources.
>
> Is it possible to schedule a web service to run at regular
> intervals?
>
> I do not want to use the Windows Task Scheduler, part of the reason is
> that we do not have full access to our clients' Windows system, and
> it's cumbersome to get them involved in setting up the task
> scheduler. So, I would like to do this completely within the IIS
> context.
>
> I googled a little, but could not find anything helpful.
>
> Any idea? Thanks.
>



 
Reply With Quote
 
antonyliu2002@yahoo.com
Guest
Posts: n/a
 
      07-24-2007
On Jul 24, 1:08 am, Sergey Poberezovskiy
<(E-Mail Removed)> wrote:
> Anthony,
>
> Web Service similar to a Web Application does not run by itself -
> somebody/something has to trigger it. In your particular case, you may not
> necessarily want to run the service as a separate process - you can check on
> every (user) call whether the required file is already created and stored (in
> the file system or ASP cache) and then either create one or retrieve it from
> the storage.
>
>
>
> "(E-Mail Removed)" wrote:
> > I have a web service, which needs to run at regular intervals (e.g.,
> > once every 2 hours) to create some PDF files for users to download.

>
> > I can certainly create a web application which lets user click a
> > button and generates the PDF file.

>
> > But since the PDF files are gonna be the same for all users, so, it
> > does not make sense to waste the server resources.

>
> > Is it possible to schedule a web service to run at regular
> > intervals?

>
> > I do not want to use the Windows Task Scheduler, part of the reason is
> > that we do not have full access to our clients' Windows system, and
> > it's cumbersome to get them involved in setting up the task
> > scheduler. So, I would like to do this completely within the IIS
> > context.

>
> > I googled a little, but could not find anything helpful.

>
> > Any idea? Thanks.- Hide quoted text -

>
> - Show quoted text -


Thanks. I think I probably check the file modification time with the
current time. If their difference is > 2, then create a new PDF,
otherwise, don't create a new one let the user download the existing
PDF.

Of course, there may be a reader/writer race condition if more than
one users wants to download the PDF at the same time. But, we may be
able to synchronize using lock, right?

Sorta enlightenment from what you said.

 
Reply With Quote
 
antonyliu2002@yahoo.com
Guest
Posts: n/a
 
      07-24-2007
On Jul 24, 1:06 am, "Cowboy \(Gregory A. Beamer\)"
<(E-Mail Removed)> wrote:
> You either have to use a scheduler or set up a service on the box that runs
> on a timer. You might be able to kludge this with an HTTP Handler, but I am
> not sure I would head down that path.
>
> One thing to consider, as a poor man's method, is to have a "time" set into
> application that increments by two hours each time it is hit. Then,
> automatically update the files when a user hits the site and the "time" has
> timed out.
>
> Or, you could make teh PDF request through a page and refresh based on a
> "timer" value. This way, you are only updating when people are requesting
> the file, but you are updating all PDFs from a single page or HTTP Handler.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBAhttp://gregorybeamer.spaces.live.com
> Co-author: Microsoft Expression Web Bible (upcoming)
>
> ************************************************
> Think outside the box!
> ************************************************


Thank you very much. But I am not sure how the timeout strategy works.

 
Reply With Quote
 
antonyliu2002@yahoo.com
Guest
Posts: n/a
 
      07-24-2007
On Jul 24, 5:01 am, "John Timney \(MVP\)"
<(E-Mail Removed)> wrote:
> Create small console exe that consumes the webservice and schedule it using
> windows scheduler.
>
> Regards
>
> John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog
>


O, I know that works, and I did that before, but this time, we do not
have full access to our clients' windows system, and we are reluctant
to have to get our clients involved in this process.

 
Reply With Quote
 
John Timney \(MVP\)
Guest
Posts: n/a
 
      07-24-2007
There are right ways and wrong ways to do things. My suggestion is the
right way - make your client see that and do the work for them if you have
to.

You could probably use SQL server and use that to call a webservice on a
timer job (if your using it).

You could even likely invoke a thread in application on start event that
acts as a poll and spawns your webservice.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> On Jul 24, 5:01 am, "John Timney \(MVP\)"
> <(E-Mail Removed)> wrote:
>> Create small console exe that consumes the webservice and schedule it
>> using
>> windows scheduler.
>>
>> Regards
>>
>> John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog
>>

>
> O, I know that works, and I did that before, but this time, we do not
> have full access to our clients' windows system, and we are reluctant
> to have to get our clients involved in this process.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDDU Web Service Directory? MLB Schedule gabe ASP .Net Web Services 0 12-21-2006 05:50 PM
Re: Schedule in asp.net Christopher Reed ASP .Net 0 01-10-2006 12:28 PM
schedule to start web server automatically Zeng ASP .Net 1 04-20-2005 12:06 AM
Exam Schedule Sir Kal MCSD 1 10-06-2004 11:06 AM
Re: schedule Pix Access-list Jeff Specoli Cisco 0 04-01-2004 03:57 PM



Advertisments