Delen via


Developing Channels

To develop a protocol or transport channel that can be used with the Windows Communication Foundation (WCF) application layer requires several steps. This topic describes those steps and points you to specific topics for more information. To understand the channel model and the various types that are mentioned in this topic, see Channel Model Overview. For a complete transport channel sample, see Transport: UDP.

The Channel Development Task List

The steps to create a user-defined channel are as follows. All channels must:

  1. Decide which of the channel Message Exchange Patterns (IOutputChannel, IInputChannel, IDuplexChannel, IRequestChannel, or IReplyChannel) your IChannelFactory and IChannelListener will support, as well as whether it will support the sessionful variations of these interfaces. For details, see Choosing a Message Exchange Pattern.

  2. Create a channel factory and listener (IChannelFactory and IChannelListener) that support your message exchange pattern. For details about developing factories, see Client: Channel Factories and Channels. For details about developing listeners, see Service: Channel Listeners and Channels.

  3. Ensure that any network-specific exceptions are normalized to either System.TimeoutException or the appropriate derived class of CommunicationException. For details, see Handling Exceptions and Faults.

  4. To enable use from the application layer, add a BindingElement that adds the custom channel to a channel stack. For more information, see Creating a BindingElement.

The following additional steps are required to enable more complete support at the application layer:

  1. Add a binding element extension section to expose the new binding element to the configuration system. For more information, see Configuration and Metadata Support.

  2. Add metadata extensions to communicate capabilities to other endpoints. For more information, see Configuration and Metadata Support.

  3. Add a binding that pre-configures a stack of binding elements according to a well-defined profile. For more information, see Creating User-Defined Bindings.

  4. Add a binding section and binding configuration element to expose the binding to the configuration system. For more information, see Configuration and Metadata Support.

See Also

Other Resources

Extending Bindings