Unhandled exceptions in WCF(Part-13)

An unhandled exception in WCF service will cause the communiaction channel to fault and the session will be lost.When there is an unhandled exception it faults the server channel. The client proxy will still be good because the BasicHttpBinding channel is not maintaining session.Once the communication channel is in fault state, we cannot use the same instance of proxy class, we need to create a new instance of proxy class.
wsHttpBinding channel is maintaining a secure session.

We will use the same Calculator service to understand the concept.please refer Exception Handling in WCF(Part-11) article to create a Calculator service.

We can catch the soap exception for service to display exception instead of white page error. for that, we will make changes in CalculatorClient.


So now when you will run the client and divide by zero then you will see “Attempted to divide by zero” in textbox3.That is nothing but the SOAP fault message.

© 2015, www.techkatak.com. All rights reserved.