birdcage
birdcage

Reputation: 2676

Calling .NET webservice automatically

I am new to .NET and web services. My aim is to create a .asmx webservice in C# which will invoke itself in every 12 hours automatically. So, there won't be anybody invoking its methods but it will invoke itself regularly. I am confused about how to do this with .NET webservices.

Upvotes: 1

Views: 11409

Answers (4)

Dan Esparza
Dan Esparza

Reputation: 28375

If it's a public webservice (or one available on the Internet, in any case) you can check out the new Azure Scheduler to invoke your webservice on a regular basis.

Upvotes: 1

cosmoloc
cosmoloc

Reputation: 2994

You can Create and schedule Jobs that will invoke every 12 Hours or say at 12am and 12pm everyday using Quartz.NET

You can create your Cron expression using :

http://www.cronmaker.com/

"InitializeScheduler()" calls the job where JobType => typeof(YourClass) with Execute() holding the required method to execute. And cron expression will identify and schedule its time

Please follow the links for further understanding on the implementation :

http://www.quartz-scheduler.net/

http://geekswithblogs.net/TarunArora/archive/2012/11/17/quartz.net-writing-your-first-hello-world-job.aspx

http://simplequartzschedulerincsharp.blogspot.in/

Works best for my requirements

Upvotes: 1

Dennis R
Dennis R

Reputation: 3237

My suggestion would be to use either a windows service or a console app scheduled to run every 12 hours by the host system's scheduling software (Windows Task Scheduler, cron, etc.).

Here is an interesting discussion on the similar requirement like yours to run a method at regular intervals and David has given various options in there.

Upvotes: 1

Samir
Samir

Reputation: 46

You Can create windows service and setup to call after every 12 hours you can easily find how to create and setup windows service

Upvotes: 0

Related Questions