語言

IChannelFactory<TChannel>.CreateChannel 方法

定義

建立指定類型的通道,連接到指定的端點位址。

多載

名稱 Description
CreateChannel(EndpointAddress)

建立指定類型的通道,連接到指定的端點位址。

CreateChannel(EndpointAddress, Uri)

建立指定類型的通道,指向指定的端點位址與傳輸位址,訊息可傳送至此。

備註

當你想手動路由時,利用 CreateChannel(EndpointAddress, Uri) 超載來區分訊息從最終目的地最初傳送到的地址。 請注意,當通道工廠關閉時,任何由此通道工廠產生的通道都會被關閉。 關於地址的討論,請參見 「地址」 主題。

CreateChannel(EndpointAddress)

來源:
IChannelFactory.cs
來源:
IChannelFactory.cs
來源:
IChannelFactory.cs

建立指定類型的通道,連接到指定的端點位址。

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)

來源:
IChannelFactory.cs
來源:
IChannelFactory.cs
來源:
IChannelFactory.cs

建立指定類型的通道,指向指定的端點位址與傳輸位址,訊息可傳送至此。

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

that 包含 Uri 訊息傳送到的傳輸位址。

傳回

TChannel

一個型態 TChannel 為通道,指向指定的端點位址與傳輸位址。

備註

由 via 所指定的傳輸位址是訊息在傳送至服務所在位置指定的其他遠端位址 to 時,應最初傳送到的位置。 在大多數網際網路情境中,viaURI 與服務最終Uri位址的 URI 相同to。 只有當你想做某種手動路由時,才會區分這兩個地址。 請注意,當通道工廠關閉時,任何由此通道工廠產生的通道都會被關閉。 關於地址的討論,請參見 「地址」 主題。

適用於