简体   繁体   中英

How to handle Transport and Communication level Exception in WCF?

I know that we can use FaultException and FaultContract to catch these exception?

Is there any other way to (Except FaultException/FaultContract) catch specifically these two Exception (Transport and Communication)?

According to the Microsoft documentation, transport and communication errors are handled by the CommunicationException class.

Communication errors occur when a network is unavailable, a client uses an incorrect address, or the service host is not listening for incoming messages. Errors of this type are returned to the client as CommunicationException or CommunicationException-derived classes.

The following provides a good overview of the three categories of WCF errors:

  • Communication Errors
  • Proxy/Channel Errors
  • Application Errors

https://docs.microsoft.com/en-us/dotnet/framework/wcf/wcf-error-handling

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM