简体   繁体   中英

WCF Exceptions thrown by ChannelFactory

I'm connecting to a service and using a Channel created by ChannelFactory. I would like to know what exceptions can be thrown while invoking service interface's methods (for example if there is a service interface named ICalculator and I'm invoking its Add(5, 4)). I can't google the topic because i don't really know how to name the problem and what exactly i'm looking for. I will be grateful for any link with that kind of information.

i mean exceptions about corrupted connection etc., not the exceptions specified by the creator of the service.

You can get:

  • FaultException or derived class (FaultException<T>) if an unhandled exception is thrown by the service implementation.

  • CommunicationException if an error occurs communicating with the service.

There may be others but these are the ones you will typically handle.

I suspect just about any type of exception you care to throw. Why would only certain exceptions be allowed?

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