Szerkesztés

Megosztás a következőn keresztül:


SupportedAddressingMode Enum

Definition

Specifies whether a service supports sending responses to anonymous addresses only, to non-anonymous addresses only, or to both.

public enum class SupportedAddressingMode
public enum SupportedAddressingMode
type SupportedAddressingMode = 
Public Enum SupportedAddressingMode
Inheritance
SupportedAddressingMode

Fields

Name Value Description
Anonymous 0

The server only supports anonymous addresses and clients must provide an anonymous response address.

NonAnonymous 1

The server only supports non-anonymous addresses and clients must provide a non-anonymous response address.

Mixed 2

The server supports both anonymous and non-anonymous addresses and clients may choose to use either or both.

Remarks

This enumeration is used to specify the capability of a server, which, in turn, imposes a requirement on its clients.

Windows Communication Foundation (WCF) has a variety of addressing controls for specifying where messages should be sent. For example, there is the logical To address for the message destination, the physical ("Via") address, used by the transport, at which a service listens, and the ReplyTo address of the endpoint that provides the address of the client endpoint.

In the most basic case, when two parties exchange messages between themselves only, it is not necessary to specify these addresses separately. But because exchanges can involve other message destinations, you must be able to specify when addresses must be explicitly provided. Even between just two parties this ability is sometimes required, as with dual HTTP where the server must create its own HTTP request. The following kinds of relationships are defined by the SupportedAddressingMode enumeration to capture these messaging patterns:

  • Anonymous addresses are the most basic form of addressing. Anonymous addressing is used when there is a default path for a response. TCP is a bi-directional communication transport and the response to a TCP message can be sent back to the other side of the socket that sent the original message. Similarly, the request-reply model of HTTP sends responses through the HTTP reply channel. Neither of these responses requires specifying where the response messages are going. When a server requires anonymous responses from the client, it uses the Anonymous value of the enumeration. The WCF system-provided NetTcpBinding, BasicHttpBinding and WSHttpBinding bindings always use Anonymous addresses.

  • NonAnonymous addresses are used when sending the response requires creating a new channel for communication. The WCF system-provided WSDualHttpBinding binding uses a NonAnonymous address. With dual HTTP, the client creates an HTTP request to send a message and then the server must create its own HTTP request to send a response. Because the server is initiating the send, it must have a specific endpoint to establish the connection. You must provide the server the address of an endpoint for its response. Similarly, if a service must respond to a one-way message that it received, it also requires a NonAnonymous address because there is no back channel available for communication. If the server sends a message back, a completely separate operation from that used to send the first message is required.

  • Mixed is a third form of addressing which combines Anonymous and NonAnonymous addresses depending on the message that is being sent. A typical example of mixed-mode addressing is the use of a dedicated machine for processing fault or acknowledgment messages. If the standard exchange sequence for replies is HTTP or TCP, the responses use Anonymous addressing but the faults use non-anonymous addressing. While WCF does not provide Mixed addressing functionality in one of its standard bindings, it is possible to write a channel that allows the service to send responses directly on the back-channel (when the response address is Anonymous) or on a separate channel (when the response address is NonAnonymous). In such a case, the binding element of the channel is used to set SupportedAddressingMode to Mixed.

Applies to