IChannelFactory<TChannel>.CreateChannel 方法

定義

建立指向指定之端點位址的指定型別通道。

多載

CreateChannel(EndpointAddress)

建立指向指定之端點位址的指定型別通道。

CreateChannel(EndpointAddress, Uri)

建立指定之端點位址的特定型別通道以及訊息傳送的目標傳輸位址。

備註

使用 CreateChannel(EndpointAddress, Uri) 多載來區分最初傳送訊息的目標位址以及當您想要執行手動路由傳送時的最終目的地。 請注意,關閉通道處理站時,會關閉此通道處理站所建立的所有通道。 如需定址的討論,請參閱 Address 主題。

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

包含訊息傳送之目標傳輸位址的 Uri

傳回

TChannel

指定之端點位址的 TChannel 型別通道和傳輸位址。

備註

via 指定的傳輸位址就是當訊息要傳送到某個其他遠端位址的途中,一開始應該先傳送的位置 (該遠端位址是由服務所在的 to 所指定)。 在大部分的網際網路情況下,via URI 與服務最終 Uri 位址的 to 相同。 當您想要執行某種手動路由傳送時,應該要區分這兩個位址。 請注意,關閉通道處理站時,會關閉此通道處理站所建立的所有通道。 如需定址的討論,請參閱 Address 主題。

適用於