While making WCF service you need to ensure that all errors needs to be logged .
For doing that we will need to use a operation contract called fault tolerance
[ServiceContract]
public interface ISimpleService
{
[OperationContract]
string SimpleOperation();
}
public class SimpleService : ISimpleService
{
public string SimpleOperation()
{
//Some code here
throw new Exception(Exception occurred at service level : SimpleOperation error);
}
}
[DataContract]
public class CustomFaultDetails
{
[DataMember]
public string ErrorID { get; set; }
[DataMember]
public string ErrorDetails { get; set; }
}
We can track the error details by creating model class for the error which contains its type and details
0 Comment(s)