user466663
user466663

Reputation: 845

How to call WCF at a scheduled timings?

I have to export data from a database in the form of flat files. I already have an asp.net website which saves data into the db. I am thinking of creating a WCF webservice project as part of the website solution. This WCF webservice will have methods to export flatfiles. I am also planning to create a console app to call this webservice at scheduled times.

I have the following questions:

  1. Once the website is hosted on IIS along with WCF, can the console app call the WCF or WCF has to be hosted separately?
  2. How to debug the process?
  3. is there any better way of doing it?

Upvotes: 0

Views: 1166

Answers (2)

Neil Thompson
Neil Thompson

Reputation: 6425

Your plan sounds fine to me.

If I were doing this I might create a WCF Service with One Way Operations so that the client app is not waiting for a response until the job is complete.

I might use Powershell and a scheduled task to hit the WCF service, or even use the free Pingdom service to hit the service endpoint at intervals.

To debug locally- if the WCF is it's own project make sure it's set as the startup project in VS, then apply break points, run debug and request the endpoint through the browser or Fiddler.

Upvotes: 1

Icarus
Icarus

Reputation: 63956

Once the website is hosted on IIS along with WCF, can the console app call the WCF or WCF has to be hosted separately?

The console app can call the WCF web service. It does not have to be hosted separately.

How to debug the process?

Ideally, on your own PC. Easy way to do is to launch the WCF Webservice within one instance of Visual Studio and the Console App on another instance of VS. You can put break points on each of the projects and follow the logic

is there any better way of doing it?

There are many ways to do one thing but yours in this case looks good to me.

Upvotes: 1

Related Questions