System.ServiceModel.Descrip ...


.NET Framework Class Library
ServiceEndpoint Class

Represents the endpoint for a service that allows clients of the service to find and communicate with the service.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Syntax

Visual Basic (Declaration)
Public Class ServiceEndpoint
Visual Basic (Usage)
Dim instance As ServiceEndpoint
C#
public class ServiceEndpoint
Visual C++
public ref class ServiceEndpoint
JScript
public class ServiceEndpoint
Remarks

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.

Examples

C#
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();
Inheritance Hierarchy

System..::.Object
  System.ServiceModel.Description..::.ServiceEndpoint
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

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.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Tags :


Page view tracker