This documentation is archived and is not being maintained.
ServiceEndpoint Class
Visual Studio 2008
Represents the endpoint for a service that allows clients of the service to find and communicate with the service.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
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
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: