Part 16 Soap faults in WCF04:33

  • 0
Published on June 5, 2017

Link for all dot net and sql server video tutorial playlists

This is continuation to Part 15. Please watch Part 15, before proceeding. In Part 15, we have learnt that, WCF serializes exceptions to SOAP faults before reporting the exception information to the client. This is because exceptions are not allowed to be passed through a wcf service channel.

SOAP faults are in XML format and are platform independent. A typical SOAP fault contains
1. FaultCode
2. FaultReason
3. Detail elements etc.

The Detail element can be used to include any custom xml. We will discuss more about Detail element in a later video session.

SOAP faults are formatted based on SOAP 1.1 or SOAP 1.2 speficications. SOAP format depends on the binding. BasicHttpBinding uses SOAP 1.1 whereas the other built-in WCF bindings use SOAP 1.2.

For the differences between SOAP 1.1 and 1.2 please refer to the following article.

The differences are not that important from a developer perspective, as WCF formats the messages automatically based on the binding we have used to expose the service.

To view SOAP Fault messages, please enable message logging in WCF. We have discussed enabling message logging in Part 9 of WCF video series.

To view SOAP 1.1 fault message, set binding to basicHttpBinding. To view SOAP 1.2 fault message, set binding to wsHttpBinding. By default Message Security is turned on for wsHttpBinding. Set the security mode for wsHttpBinding to None, so we could view the SOAP 1.2 fault message.

Tags:, , , ,
Enjoyed this video?
"No Thanks. Please Close This Box!"