ChannelFactoryBase<TChannel>.CreateChannel 方法
定义
使用指定的地址创建特定类型的通道。Creates a particular type of channel with a specified address.
重载
| CreateChannel(EndpointAddress) |
使用指定的终结点地址创建特定类型的通道。Creates a particular type of channel with a specified endpoint address. |
| CreateChannel(EndpointAddress, Uri) |
使用指定的传输和终结点地址创建特定类型的通道。Creates a particular type of channel with specified transport and endpoint addresses. |
CreateChannel(EndpointAddress)
使用指定的终结点地址创建特定类型的通道。Creates a particular type of channel with a specified endpoint address.
public:
virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress address);
abstract member CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
Public Function CreateChannel (address As EndpointAddress) As TChannel
参数
- address
- EndpointAddress
EndpointAddress,它是通道发送消息的目标远程终结点。The EndpointAddress of the remote endpoint to which the channel sends messages.
返回
- TChannel
一个 TChannel 类型的通道,它具有指定的 address。A channel of type TChannel with the specified address.
实现
例外
address 为 null。address is null.
注解
受到调用时,此方法调用 OnCreateChannel(EndpointAddress, Uri)。This method calls OnCreateChannel(EndpointAddress, Uri) when invoked. 此方法不能由派生类重写。This method cannot be overridden by a derived class.
它将 Uri 用作输出通道发送消息的目标传输地址。This uses Uri as the transport address to which messages are sent on the output channel.
适用于
CreateChannel(EndpointAddress, Uri)
使用指定的传输和终结点地址创建特定类型的通道。Creates a particular type of channel with specified transport and endpoint addresses.
public:
virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address, Uri ^ via);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress address, Uri via);
abstract member CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Function CreateChannel (address As EndpointAddress, via As Uri) As TChannel
参数
- address
- EndpointAddress
EndpointAddress,它是通道发送消息的目标远程终结点。The EndpointAddress of the remote endpoint to which the channel sends messages.
- via
- Uri
Uri,包含输出通道发送消息的目标传输地址。The Uri that contains the transport address to which messages are sent on the output channel.
返回
- TChannel
TChannel 类型的通道,具有指定的远程和传输地址。A channel of type TChannel with the specified remote and transport addresses.
实现
注解
受到调用时,此方法调用 OnCreateChannel(EndpointAddress, Uri)。This method calls OnCreateChannel(EndpointAddress, Uri) when invoked.