Export (0) Print
Expand All

ChannelFactory<TChannel> Constructor (String, EndpointAddress)

Initializes a new instance of the ChannelFactory<TChannel> class associated with a specified name for the endpoint configuration and remote address.

Namespace:  System.ServiceModel
Assemblies:   System.ServiceModel (in System.ServiceModel.dll)
  System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)

public ChannelFactory(
	string endpointConfigurationName,
	EndpointAddress remoteAddress
)

Parameters

endpointConfigurationName
Type: System.String

The configuration name used for the endpoint.

remoteAddress
Type: System.ServiceModel.EndpointAddress

The EndpointAddress that provides the location of the service.

ExceptionCondition
ArgumentNullException

endpointConfigurationName or remoteAddress is null.

EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint", address);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft