ServiceEndpoint.Address 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定服務端點的端點位址。
public:
property System::ServiceModel::EndpointAddress ^ Address { System::ServiceModel::EndpointAddress ^ get(); void set(System::ServiceModel::EndpointAddress ^ value); };
public System.ServiceModel.EndpointAddress Address { get; set; }
member this.Address : System.ServiceModel.EndpointAddress with get, set
Public Property Address As EndpointAddress
屬性值
指定服務端點的位置的 EndpointAddress。
範例
下列範例將示範如何將 ServiceEndpoint 加入至現有的 ServiceHost 並顯示位址屬性:
ServiceEndpoint endpnt = serviceHost.AddServiceEndpoint(
typeof(ICalculator),
new WSHttpBinding(),
"CalculatorServiceObject");
Console.WriteLine("Address: {0}", endpnt.Address);
Dim endpnt As ServiceEndpoint = serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")
Console.WriteLine("Address: {0}", endpnt.Address)
備註
服務端點接聽的 ListenUri 的預設值是由 Uri 傳回的 EndpointAddress 的 Address 所提供。