Exception Handling in Service Oriented Applications

Retired Content

The Web Service Software Factory is now maintained by the community and can be found on the Service Factory site.

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Retired: November 2011

Exception handling is a technique that allows an application to detect and possibly recover from errors during execution. Handling exceptions that occur across service boundaries is an important issue that must be considered when designing an application that will operate in a distributed environment. You must be careful to not inadvertently pass sensitive information that can be used in a malicious way to the client application. Also, you should define the different types of errors or exceptions that your service can return so that client applications can appropriately handle them.

To build successful and flexible applications that can be easily maintained and supported, you must adopt an appropriate strategy for exception management. You must design your system to ensure that it is capable of the following:

  • Detecting exceptions
  • Logging and reporting information
  • Replacing an internal exception with information that can be safely returned to a client application over an insecure network
  • Generating events that can be monitored externally to assist system operation

The following topics give a brief overview of exception handling in Windows Communication Foundation (WCF):