ChannelFactory(TChannel) Constructor (Binding, EndpointAddress)
Collapse the table of content
Expand the table of content

ChannelFactory<TChannel> Constructor (Binding, EndpointAddress)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

public ChannelFactory(
	Binding binding,
	EndpointAddress remoteAddress
)

Parameters

binding
Type: System.ServiceModel.Channels.Binding
The Binding used to configure the channels created by the factory.
remoteAddress
Type: System.ServiceModel.EndpointAddress
The destination EndpointAddress for channels created by the factory.

ExceptionCondition
ArgumentNullException

The binding is null.


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



Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft