Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.4 KB

how-to-use-the-channelfactory.md

File metadata and controls

25 lines (18 loc) · 1.4 KB
title description ms.date dev_langs ms.assetid
How to: Use the ChannelFactory
Learn how to create a channel factory to create more than one channel for accessing services by using a WCF client.
03/30/2017
csharp
vb
d48f01b5-582b-4c8b-b547-8adddae7e371

How to: Use the ChannelFactory

The generic xref:System.ServiceModel.ChannelFactory%601 class is used in advanced scenarios that require the creation of a channel factory that can be used to create more than one channel.

To create and use the ChannelFactory class

  1. Build and run an Windows Communication Foundation (WCF) service. For more information, see Designing and Implementing Services, Configuring Services, and Hosting Services.

  2. Use the ServiceModel Metadata Utility Tool (Svcutil.exe) to generate the contract (interface) for the client.

  3. In the client code, use the xref:System.ServiceModel.ChannelFactory%601 class to create multiple endpoint listeners.

Example

[!code-csharpc_HowToUseChannelFactory#1] [!code-vbc_HowToUseChannelFactory#1]