When consuming a WCF service, it is common to generate a strong-typed client proxy class (either through Visual Studio's Add Service Reference context menu item or .NET SDK's Svcutil.exe tool) for invoking service operation. However, there are many cases in which we will need to get rid of this kind of auto-generated service proxy class. For example, we may need to directly reuse the existing types (including the
ServiceContract type and custom data types) used in the service definition, or we might just need a lightweight component to invoke a service operation. For such scenarios, we can use the
ChannelFactory class to directly communicate with the target WCF service endpoint.