Partager via


ChannelFactory<TChannel> Constructor (Binding, EndpointAddress)

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

Initializes a new instance of the ChannelFactory<TChannel> class with a specified endpoint address and binding configuration.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Syntax

'Declaration
Public Sub New ( _
    binding As Binding, _
    remoteAddress As EndpointAddress _
)
public ChannelFactory(
    Binding binding,
    EndpointAddress remoteAddress
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

The binding is nulla null reference (Nothing in Visual Basic).

Examples

            'Create a request channel specifying a remote endpoint address
            Dim address3 As New EndpointAddress("https://localhost:8000/ChannelApp")
            Dim factory3 As New ChannelFactory(Of IRequestChannel)("MyEndpointConfig")
            factory3.CreateChannel(address3)

            //Create a request channel specifying a remote endpoint address
            EndpointAddress address3 = new EndpointAddress("https://localhost:8000/ChannelApp");
            ChannelFactory<IRequestChannel> factory3 = new ChannelFactory<IRequestChannel>("MyEndpointConfig");
            factory3.CreateChannel(address3);

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.