Tallan Blog

Tallan’s Experts Share Their Knowledge on Technology, Trends and Solutions to Business Challenges

Posts Tagged "3.5"

Recover from a WCF Service Fault, Part 2 (Generic ServiceClientFactory Class)

After finding the simple solution for handling WCF Service Faults I figured it should be relatively trivial to find a generic solution to this problem if you’re using similar WCF clients in a project and want to reset ALL of them on a channel fault.  I developed a generic ServiceClientFactory class that will generate a WCF Service Client instance from a generic “GetClient” function and will automatically handle resetting of faulted channels.
Class Implementation Source Code:
/* Service Client Factory
* Author: Michael Gerety, Senior Consultant, Tallan, Inc.
* Description: A generic service client factory that automatically
* resets faulted channels for WCF services that have
* endpoints and behaviors defined in web/app.config files.

using System;