EndpointAddress.ApplyTo(Message) Method

Definition

Assigns the URI and properties of the endpoint address to the values of the headers of a specified message.

C#
public void ApplyTo(System.ServiceModel.Channels.Message message);

Parameters

message
Message

The Message whose header values are being assigned.

Exceptions

message is null.

Examples

The following code shows how to apply the URI and properties of an endpoint address to the headers of a message.

C#
Message msg = Message.CreateMessage(MessageVersion.Soap11, "urn:action");
endpointAddress.ApplyTo(msg);

Remarks

The ApplyTo(Message) method sets the "To" of the message with the Uri of the current EndpointAddress. Remember that "ApplyTo" means here "apply this address to the 'To' header of the message".

Applies to

Proizvod Verzije
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0