This documentation is archived and is not being maintained.

EndpointAddress10.ToEndpointAddress Method

Retrieves the endpoint address contained in this serializable type.

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

public EndpointAddress ToEndpointAddress()

Return Value

Type: System.ServiceModel.EndpointAddress
The EndpointAddress used to initialize the instance of this class.

This example shows how convert an EndpointAddress10 into an EndpointAddress.

// Create an EndpointAddress with a specified address.
EndpointAddress epa1 = new EndpointAddress("http://localhost/ServiceModelSamples");
Console.WriteLine("The URI of the EndpointAddress is {0}:", epa1.Uri);

//Initialize an EndpointAddress10 from the endpointAddress.
EndpointAddress10 epa10 = EndpointAddress10.FromEndpointAddress(epa1);

//Serialize and then deserializde the Endpoint10 type. 

//Convert the EndpointAddress10 back into an EndpointAddress.
EndpointAddress epa2 = epa10.ToEndpointAddress();

Console.WriteLine("The URI of the EndpointAddress is still {0}:", epa2.Uri);

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