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 类。

例外

addressnull

示例

// 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 规范版本相关联,也没有绑定到特定的连网格式。

适用于