![]() Due to some calculation error condition, let’s assume we are throwing this error. ![]() Throw new FaultException(ex, new FaultReason("This is an error condition in BasicMath.Addition method")) } Public class BasicMath : IBasicMathServiceīasicMathFault ex = new BasicMathFault() Įx.ExceptionMessage = "Could not perform addition operation." Įx.InnerException = "Inner exception from math service" Let’s come to see from example on how to do exception handling in WCF application. For this System.ServiceModel namespace comes FaultException class and FaultContract attribute. With use of SOAP fault, the verbose exception message is reduced to Code and Message. Net exceptions to client in much readable and convenient way to support interoperability. ![]() WCF has two types of error handling mechanism: one is by as usual Exception objects, and other is by SOAP fault message. So the communication process of this service or service method level errors to client via wire becomes a little bit tricky. When we develop SOA applications, our application is not limited to mere one technology or single loyal client. We have been doing exception handling in managed application using try-catch block with Exception or its derived Custom Exception objects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |