Bagikan melalui


ServiceEndpoint.Address Properti

Definisi

Mendapatkan atau mengatur alamat titik akhir untuk titik akhir layanan.

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

Nilai Properti

EndpointAddress yang menentukan lokasi titik akhir layanan.

Contoh

Contoh berikut menunjukkan cara menambahkan ServiceEndpoint ke properti alamat yang sudah ada ServiceHost dan ditampilkan:

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)

Keterangan

Nilai ListenUri default di mana titik akhir layanan mendengarkan disediakan oleh Uri yang EndpointAddress dikembalikan oleh Address.

Berlaku untuk