ServiceEndpoint.ListenUri Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the URI at which the service endpoint listens.
public:
property Uri ^ ListenUri { Uri ^ get(); void set(Uri ^ value); };
public Uri ListenUri { get; set; }
member this.ListenUri : Uri with get, set
Public Property ListenUri As Uri
Property Value
The Uri at which the service endpoint listens. The default value is provided by Uri of the EndpointAddress returned by Address.
Examples
Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);
ServiceEndpoint endpoint = serviceHost.AddServiceEndpoint(
typeof(ICalculator),
new WSHttpBinding(),
"CalculatorServiceObject");
Console.WriteLine("Service endpoint {0} contains the following:", endpoint.Name);
Console.WriteLine("Binding: {0}", endpoint.Binding.ToString());
Console.WriteLine("Contract: {0}", endpoint.Contract.ToString());
Console.WriteLine("ListenUri: {0}", endpoint.ListenUri.ToString());
Console.WriteLine("ListenUriMode: {0}", endpoint.ListenUriMode.ToString());
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)
Dim endpoint As ServiceEndpoint = serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")
Console.WriteLine("Service endpoint {0} contains the following:", endpoint.Name)
Console.WriteLine("Binding: {0}", endpoint.Binding.ToString())
Console.WriteLine("Contract: {0}", endpoint.Contract.ToString())
Console.WriteLine("ListenUri: {0}", endpoint.ListenUri.ToString())
Console.WriteLine("ListenUriMode: {0}", endpoint.ListenUriMode.ToString())
Remarks
The value can also be set using the ListenUri property.
Applies to
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.