EndpointAddress Constructor (Uri^, EndpointIdentity^, array<AddressHeader^>^)

 

Initializes a new instance of the EndpointAddress class with a specified URI, identity, and headers.

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

public:
EndpointAddress(
	Uri^ uri,
	EndpointIdentity^ identity,
	... array<AddressHeader^>^ addressHeaders
)

Parameters

uri
Type: System::Uri^

The Uri that identifies the endpoint location.

identity
Type: System.ServiceModel::EndpointIdentity^

The EndpointIdentity for the endpoint.

addressHeaders
Type: array<System.ServiceModel.Channels::AddressHeader^>^

The Array of type AddressHeader that contains address information used to interact with the endpoint.

The following code shows how to construct an EndpointAddress object with a Uri, EndpointIdentity and an array of AddressHeader objects.

      //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 };

      EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);

      EndpointAddress endpointAddress = new EndpointAddress(
          new Uri
("http://localhost:8003/servicemodelsamples/service/incode/identity"),
endpointIdentity, addressHeaders);


Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Return to top
Show: