Export (0) Print
Expand All

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)

public class ServiceEndpoint

The ServiceEndpoint type exposes the following members.

  NameDescription
Public methodSupported by Portable Class LibraryServiceEndpoint(ContractDescription)Initializes a new instance of the ServiceEndpoint class for a specified contract.
Public methodSupported by Portable Class LibraryServiceEndpoint(ContractDescription, Binding, EndpointAddress)Initializes a new instance of the ServiceEndpoint class with a specified contract, binding, and address.
Top

  NameDescription
Public propertySupported by Portable Class LibraryAddressGets or sets the endpoint address for the service endpoint.
Public propertyBehaviorsGets the behaviors for the service endpoint.
Public propertySupported by Portable Class LibraryBindingGets or sets the binding for the service endpoint.
Public propertySupported by Portable Class LibraryContractGets the contract for the service endpoint.
Public propertyIsSystemEndpointGets or sets whether the service endpoint is generated by the system as opposed to being user-defined.
Public propertyListenUriGets or sets the URI at which the service endpoint listens.
Public propertyListenUriModeGets or sets how the transport handles the URI that is provided for the service to listen on.
Public propertySupported by Portable Class LibraryNameGets or sets the name of the service endpoint.
Top

  NameDescription
Public methodSupported by Portable Class LibraryEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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();


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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

Community Additions

ADD
Show:
© 2014 Microsoft