ServiceEndpoint.Address 属性

定义

获取或设置服务终结点的终结点地址。

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

指定服务终结点的位置的 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 返回的 EndpointAddressAddress 提供的。

适用于