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^)
.NET Framework (current version)
Initializes a new instance of the ChannelFactory<TChannel> class that produces channels with a specified endpoint.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
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
Available since 3.0
Show: