Partager via


ChannelFactory<TChannel>.CreateChannel Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Creates a channel of a specified type to communicate with a specified endpoint address.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method CreateChannel() Creates a channel that is used to send messages to a service.
Public methodSupported by Silverlight for Windows Phone CreateChannel(EndpointAddress) Creates a channel that is used to send messages to a service at a specific endpoint address.
Public methodSupported by Silverlight for Windows Phone CreateChannel(EndpointAddress, Uri) Creates a channel that is used to send messages to a service at a specific endpoint address through a specified transport address.

Top

Remarks

Creates a channel of type TChannel, the generic parameter for the class.

Examples

            'Create a request channel specifying a remote endpoint address and a transport address.
            Dim address4 As New EndpointAddress("https://localhost:8000/ChannelApp")
            Dim via4 As New Uri("https://localhost:8000/Via")
            Dim factory4 As New ChannelFactory(Of IRequestChannel)("MyEndpointConfig")
            Dim channel4 As IRequestChannel = factory4.CreateChannel(address4, via4)

            //Create a request channel specifying a remote endpoint address and a transport address.
            EndpointAddress address4 = new EndpointAddress("https://localhost:8000/ChannelApp");
            Uri via4 = new Uri("https://localhost:8000/Via");
            ChannelFactory<IRequestChannel> factory4 = new ChannelFactory<IRequestChannel>("MyEndpointConfig");
            IRequestChannel channel4 = factory4.CreateChannel(address4, via4);