difference between wcf fault exception and normal .net exception

1
S.No WCF Fault Exception .NET Exception 1 What is WCF Fault Exception ? If we use a raise a fault exception as shown in the below code, our WCF clients will see the complete clear error rather than a generic error as shown in .NET Exception example. throw new FaultException("Divide by zero"); Our WCF client will now see a better error description as shown in the WCF Fault example. Example is provided at the bottom of the table What is .NET Exception ? If we throw a normal .NET exception from a WCF service as shown in the below code snippet. throw new Exception("Divide by zero"); Our WCF client will get a very generic error with a message as shown in the .NET Exception example. Now this kind of message can be very confusing as it does not pinpoint what exactly the error is Example is provided at the bottom of the table Example for WCF Fault Exception: Example for generic .NET Exception: Reference: http://onlydifferencefaqs.blogspot.in/2014/03/difference-between-wcf-fault-exception.html

Upload: umar-ali

Post on 10-May-2015

1.064 views

Category:

Technology


2 download

DESCRIPTION

Difference between WCF Fault Exception and normal .NET Exception

TRANSCRIPT

Page 1: Difference between wcf fault exception and normal .net exception

S.No WCF Fault Exception .NET Exception

1 What is WCF Fault Exception ?If we use a raise a fault exception as shown in the below code, our WCF clients will see the complete clear error rather than a generic error as shown in .NET Exception example.

throw new FaultException("Divide by zero");

Our WCF client will now see a better error description as shown in the WCF Fault example.

Example is provided at the bottom of the table

What is .NET Exception ?If we throw a normal .NET exception from a WCF service as shown in the below code snippet.

throw new Exception("Divide by zero");

Our WCF client will get a very generic error with a message as shown in the .NET Exception example. Now this kind of message can be very confusing as it does not pinpoint what exactly the error is

Example is provided at the bottom of the table

Example for WCF Fault Exception:

Example for generic .NET Exception:

Reference:

http://onlydifferencefaqs.blogspot.in/2014/03/difference-between-wcf-fault-exception.html