Exception handling (Exception, FaultException, FaultException, Ierrorhandler)
Introduced
WCF (Windows communication Foundation)-Exception handling: General exception processing, faultexception and faultexception throwing and handling, Use Ierrorhandler to handle exceptions.
Example
1. Service
IHello.cs
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.ServiceModel;
Namespace WCF. Servicelib.exception
{
/**////<summary>
///Ihello interface
///</summary>
[SERVICEC ONTRACT] public
interface Ihello
{
/**////<summary>
///Throw exception exception
/// </summary>
[OperationContract]
void Helloexception ();
/**////<summary>
///throw faultexception exception
///</summary>
[OperationContract]
void Hellofaultexception ();
/**////<summary>
///throws faultexception<t> exception
///</summary>
[OperationContract ]
[Faultcontract (typeof (Faultmessage))]
void Hellofaultexceptiongeneric ();
/**////<summary>
///ierrorhandler processing exception
///</summary>
[OperationContract]
void Helloierrorhandler ();
}
}