Each ServiceModel binding element in the application configuration file has a security child element through which you can set the desired security mode.
The binding determines which security protocol is used to protect communications. The properties that are available depend on which binding you are using.
The security mode defines the aspects of SOAP message security and transport security that WCF applies when you send and receive messages. For a service to run correctly, the host and the client application must use the same security mode.
How WCF Delivers Message-Level Integrity and Confidentiality
Security Objectives in WCF
Handling Service Exceptions on WCF Clients
When an unexpected exception occurs, the WCF runtime generates a FaultException and sends it to the client.
It is good practice to add an outer try block to all of your service operations; the try block should encompass all of the code that is inside those operations.
Typed faults enable you to define custom data types to represent specific errors that occur in your WCF service.
It is important that your service handles errors so that it can continue to execute if an error occurs. There are three main categories of errors that your service should handle.