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.

System.Object
  System.ServiceModel.Description.ServiceEndpoint

Namespace:  System.ServiceModel.Description
Assemblies:   System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)
  System.ServiceModel (in System.ServiceModel.dll)

public class ServiceEndpoint

The ServiceEndpoint type exposes the following members.

  NameDescription
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsServiceEndpoint(ContractDescription)Initializes a new instance of the ServiceEndpoint class for a specified contract.
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsServiceEndpoint(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 LibrarySupported in .NET for Windows Store appsAddressGets or sets the endpoint address for the service endpoint.
Public propertyBehaviorsGets the behaviors for the service endpoint.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsBindingGets or sets the binding for the service endpoint.
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsContractGets the contract for the service endpoint.
Public propertySupported in .NET for Windows Store appsEndpointBehaviorsGets the endpoint behaviors for the service.
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 LibrarySupported in .NET for Windows Store appsNameGets or sets the name of the service endpoint.
Top

  NameDescription
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsFinalizeAllows 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 LibrarySupported in .NET for Windows Store appsGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsToStringReturns 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.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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.
Show:
© 2014 Microsoft