Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ChannelFactory<TChannel> Constructor (ServiceEndpoint^)

 

Initializes a new instance of the ChannelFactory<TChannel> class that produces channels with a specified endpoint.

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

public:
ChannelFactory(
	ServiceEndpoint^ endpoint
)

Parameters

endpoint
Type: System.ServiceModel.Description::ServiceEndpoint^

The ServiceEndpoint for the channels produced by the factory.

Exception Condition
ArgumentNullException

The endpoint is null.

Use this constructor when you want to pass the service endpoint information programmatically rather than using an application configuration file.

ContractDescription contract = new ContractDescription("MyContract");
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
BasicHttpBinding binding = new BasicHttpBinding();
ServiceEndpoint endpoint = new ServiceEndpoint(contract, binding, address);

ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(endpoint);

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft