Fault Contracts is the way to handle exceptions in WCF. The problem with exceptions is that those are technology specific and therefore cannot be passed to other end because of interoperability issue. SOAP fault is another way of representing the exception to support the interoperability.
Soap faults are not specific to any particular technology and they are based on industry standards.
To support SOAP Faults WCF provides FaultException class. This class has two forms:
FaultException : to send untyped fault back to consumer
FaultException<T>: to send typed fault data to the client
WCF service also provides FaultContract attribute so that developer can specify which fault can be sent by the operation (method). This attribute can be applied to operations only.
Explain Fault Contracts in WCF? | WCF Interview Question
Popular Tutorials
- Creating Cookie in ASP.NET MVC Action | Handling Cookies in ASP.NET MVC | Set Cookie Expiry in ASP.NET MVC | ASP.NET MVC Tutorial
- Generating Multiline TextBox or TextArea with @Html.EditorFor in ASP.NET MVC
- Generating Unique Token in C# | Generating Unique Token that Expires after 24 Hours in C# | C# Tutorial
- Drag & Drop File Upload In ASP.NET MVC Using dropzone js with Fallback Browser Support | ASP.NET MVC Tutorial
- Loading PartialView Via JQuery In ASP.NET MVC | Returning PartialView From ASP.NET MVC Action | ASP.NET MVC Tutorial
- How To Enable Role Manager Feature In ASP.NET MVC? | ASP.NET MVC Interview Question
- How To Add CSS Class And Custom Property in Html.TextBoxFor? | ASP.NET MVC | RAZOR
- Send and Receive SMS and MMS Messages Using Android 4.4 SMS API | Android Video Tutorial
- How to Get Browser Agent from ASP.NET Web API Controller? | ASP.NET Web API Tutorial
- How to Override the Common Route Prefix? | ASP.Net MVC Interview Question