Rediger

Del via


EndpointAddress.AnonymousUri Property

Definition

Gets a version-neutral representation of the anonymous URI.

public:
 static property Uri ^ AnonymousUri { Uri ^ get(); };
public static Uri AnonymousUri { get; }
static member AnonymousUri : Uri
Public Shared ReadOnly Property AnonymousUri As Uri

Property Value

Uri

A Uri with the value http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous.

Examples

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 headers = new AddressHeaderCollection(addressHeaders);

EndpointIdentity endpointIdentity =
    EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
    new Uri
    ("http://localhost:8003/servicemodelsamples/service/incode/identity"),
    endpointIdentity, addressHeaders);

Uri anonUri = EndpointAddress.AnonymousUri;

Remarks

If the value of the URI used to initialize the constructor is the AnonymousUri, then IsAnonymous is set to true.

EndpointAddress is a version-neutral class and the AnonymousUri property returns a value is a neutral representation. When you write this out or convert this to one version or the other, then it turns into the right value for that version.

Due to the range of network technologies currently in widespread use (for example, NAT, DHCP, and firewalls), many deployments cannot assign a meaningful global URI to a given endpoint. To allow these anonymous endpoints to initiate message exchange patterns and receive replies, the Web Services Addressing specification defines a URI for use by endpoints that cannot have a stable, resolvable URI.

Requests that use this address must provide some mechanism for delivering replies or faults (for example, returning the reply on the same transport connection). This mechanism can be a request/reply transport protocol (for example, HTTP GET or POST). This URI can be used as the destination for reply messages and should not be used as the destination in other circumstances.

Applies to