EndpointAddress10.FromEndpointAddress(EndpointAddress) Метод

Определение

Инициализирует новый экземпляр класса EndpointAddress10 с указанным адресом конечной точки.

public:
 static System::ServiceModel::EndpointAddress10 ^ FromEndpointAddress(System::ServiceModel::EndpointAddress ^ address);
public static System.ServiceModel.EndpointAddress10 FromEndpointAddress (System.ServiceModel.EndpointAddress address);
static member FromEndpointAddress : System.ServiceModel.EndpointAddress -> System.ServiceModel.EndpointAddress10
Public Shared Function FromEndpointAddress (address As EndpointAddress) As EndpointAddress10

Параметры

address
EndpointAddress

Объект EndpointAddress, используемый для инициализации экземпляра этого класса.

Возвращаемое значение

EndpointAddress10

Класс EndpointAddress10, содержащий указанный адрес конечной точки.

Исключения

address имеет значение null.

Примеры

// 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);
Console.WriteLine();

//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);
Console.WriteLine();
' Create an EndpointAddress with a specified address.
Dim epa1 As New EndpointAddress("http://localhost/ServiceModelSamples")
Console.WriteLine("The URI of the EndpointAddress is {0}:", epa1.Uri)
Console.WriteLine()

'Initialize an EndpointAddress10 from the endpointAddress.
Dim epa10 As EndpointAddress10 = EndpointAddress10.FromEndpointAddress(epa1)

'Serialize and then deserializde the Endpoint10 type.

'Convert the EndpointAddress10 back into an EndpointAddress.
Dim epa2 As EndpointAddress = epa10.ToEndpointAddress()

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

Комментарии

Объект EndpointAddress не привязан к конкретной версии спецификации WS-Addressing или к конкретному формату подключения.

Применяется к