IChannelFactory<TChannel>.CreateChannel 方法

定义

创建到指定终结点地址的指定类型的通道。

重载

CreateChannel(EndpointAddress)

创建到指定终结点地址的指定类型的通道。

CreateChannel(EndpointAddress, Uri)

创建指定类型的通道,该通道通向消息要发送到的指定终结点地址和传输地址。

注解

利用 CreateChannel(EndpointAddress, Uri) 重载区分最初消息要发送到的地址与希望进行手动路由时的最终目标。 请注意,当此通道工厂关闭时,此通道工厂创建的任何通道也将关闭。 有关寻址的讨论,请参阅 地址 主题。

CreateChannel(EndpointAddress)

创建到指定终结点地址的指定类型的通道。

public:
 TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ to);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress to);
abstract member CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
Public Function CreateChannel (to As EndpointAddress) As TChannel

参数

to
EndpointAddress

提供服务位置的 EndpointAddress

返回

TChannel

到指定终结点地址的类型为 TChannel 的通道。

注解

利用 CreateChannel(EndpointAddress, Uri) 重载区分最初消息要发送到的地址与希望进行手动路由时的最终目标。 请注意,当此通道工厂关闭时,此通道工厂创建的任何通道也将关闭。

适用于

CreateChannel(EndpointAddress, Uri)

创建指定类型的通道,该通道通向消息要发送到的指定终结点地址和传输地址。

public:
 TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ to, Uri ^ via);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress to, Uri via);
abstract member CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Function CreateChannel (to As EndpointAddress, via As Uri) As TChannel

参数

to
EndpointAddress

提供服务位置的 EndpointAddress

via
Uri

Uri,包含要将消息发送至的传输地址。

返回

TChannel

到指定终结点地址和传输地址的 TChannel 类型的通道。

注解

via 指定的传输地址是消息在发送到由 to 指定的服务所在的某个其他远程地址的途中,最初应发送到的位置。 在大多数 Internet 方案中,via URI 和服务的最终 Uri 地址的 to 相同。 您只在进行某种手动路由时才区分这两个地址。 请注意,当此通道工厂关闭时,此通道工厂创建的任何通道也将关闭。 有关寻址的讨论,请参阅 地址 主题。

适用于