views:

24

answers:

2

Hi, I have a WCF application hosted as a windows service. This windows service triggers this WCF every 15 minutes. But when an exception occurs in this WCF the service is getting stopped.

I don't want this service to stop. I want to some how handle this exception and trigger this WCF after another 15 minutes.

How can i do that? Please help, its urgent.

A: 

Look for the ServiceHost.Open(...) and put a try/catch around it perhaps.

Noel Abrahams
ServiceHost.Open is a non-blocking operation, which means it'll open it, then exit, thus making the try/catch block redundant.
Nathan Ridley
Yes, fair point.
Noel Abrahams
+1  A: 

You should handle exceptions in all your service operations in order to:

  • Return nice faults to the caller
  • Prevent the service from failing miserably

Put a try/catch around every operation or use a custom behavior to handle all exceptions coming from your service

Johann Blais