Represents the endpoint for a service that allows clients of the service to find and communicate with the service.
Public Class ServiceEndpoint
Dim instance As ServiceEndpoint
public class ServiceEndpoint
public ref class ServiceEndpoint
The service endpoint contains the information about the address, binding, contract, and behavior required by a client to find and interact with the service at this endpoint.
Uri baseAddress = new Uri("http://localhost:8001/Simple"); ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress); ContractDescription cd = new ContractDescription("Calculator"); ServiceEndpoint svcEndpoint = new ServiceEndpoint(cd); ServiceEndpoint endpnt = serviceHost.AddServiceEndpoint( typeof(ICalculator), new WSHttpBinding(), "CalculatorServiceObject"); Console.WriteLine("Address: {0}", endpnt.Address); // Enable Mex ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; serviceHost.Description.Behaviors.Add(smb); serviceHost.Open();
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003