Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 Endpoints Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ServiceDescription..::.Endpoints Property

Gets the collection of endpoints from the service description.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Visual Basic (Declaration)
Public ReadOnly Property Endpoints As ServiceEndpointCollection
Visual Basic (Usage)
Dim instance As ServiceDescription
Dim value As ServiceEndpointCollection

value = instance.Endpoints
C#
public ServiceEndpointCollection Endpoints { get; }
Visual C++
public:
property ServiceEndpointCollection^ Endpoints {
    ServiceEndpointCollection^ get ();
}
JScript
public function get Endpoints () : ServiceEndpointCollection

Property Value

Type: System.ServiceModel.Description..::.ServiceEndpointCollection
The ServiceEndpointCollection that contains the endpoints defined for the service.

The endpoints in the ServiceEndpointCollection returned by this method each contain the address, binding, contract, and behavior information required to communicate with the service. To access this information, you must retrieve the ServiceEndpoint from the collection with the Find method that employs the relevant search criteria. Then the ServiceEndpoint properties can be used to access the information. For example, the ContractDescription is accessed by the Contract property.

Export metadata about a service endpoint by passing ServiceEndpoint as a parameter to ExportEndpoint(ServiceEndpoint).

C#
// Iterate through the endpoints contained in the ServiceDescription
ServiceEndpointCollection sec = svcDesc.Endpoints;
foreach (ServiceEndpoint se in sec)
{
    Console.WriteLine("Endpoint:");
    Console.WriteLine("\tAddress: {0}", se.Address.ToString());
    Console.WriteLine("\tBinding: {0}", se.Binding.ToString());
    Console.WriteLine("\tContract: {0}", se.Contract.ToString());
    KeyedByTypeCollection<IEndpointBehavior> behaviors = se.Behaviors;
    foreach (IEndpointBehavior behavior in behaviors)
    {
        Console.WriteLine("Behavior: {0}", behavior.ToString());
    }
}

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.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker