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>::CreateChannel Method (Binding^, EndpointAddress^, Uri^)
.NET Framework (current version)
Creates a channel of a specified type that is used to send messages to a service endpoint at a specified transport address that is configured with a specified binding.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
public: static TChannel CreateChannel( Binding^ binding, EndpointAddress^ endpointAddress, Uri^ via )
Parameters
- binding
-
Type:
System.ServiceModel.Channels::Binding^
The Binding used to configure the endpoint.
- endpointAddress
-
Type:
System.ServiceModel::EndpointAddress^
The EndpointAddress that provides the location of the service.
- via
-
Type:
System::Uri^
The Uri that contains the transport address to which the channel sends messages.
| Exception | Condition |
|---|---|
| InvalidOperationException | The ChannelFactory has duplex operations it does not support. |
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
Uri uri = new Uri("http://localhost:8000/Via");
IRequestChannel channel =
ChannelFactory<IRequestChannel>.CreateChannel(binding, address, uri);
channel.Open();
.NET Framework
Available since 3.0
Available since 3.0
Show: