Search code examples
c#wcfweb-serviceschannelfactory

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.


Solution

  • 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.