EndpointAddress Constructor (Uri, EndpointIdentity, AddressHeaderCollection)
Initializes a new instance of the EndpointAddress class with a specified URI, identity, and header collection.
Namespace: System.ServiceModel
Assembly: System.ServiceModel (in System.ServiceModel.dll)
public EndpointAddress(
Uri uri,
EndpointIdentity identity,
AddressHeaderCollection headers
)
Parameters
- uri
- Type: System.Uri
The Uri that identifies the endpoint location.
- identity
- Type: System.ServiceModel.EndpointIdentity
The EndpointIdentity for the endpoint.
- headers
- Type: System.ServiceModel.Channels.AddressHeaderCollection
The AddressHeaderCollection that contains address information used to interact with the endpoint.
The following code shows how to construct a EndpointAddress object with a Uri, EndpointIdentity and an AddressHeaderCollection object.
//Create new address headers for special services and add them to an array
AddressHeader addressHeader1 = AddressHeader.CreateAddressHeader("specialservice1", "http://localhost:8000/service", 1);
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
AddressHeaderCollection addressHeaderColl = new AddressHeaderCollection(addressHeaders);
// <Snippet#15>
EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"),
endpointIdentity,
addressHeaderColl);
EndpointIdentity thisEndpointIdentity = endpointAddress.Identity;
// </Snippet#15>
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.