EndpointAddress.ApplyTo Method

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

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

public void ApplyTo(
	Message message
)

Parameters

message
Type: System.ServiceModel.Channels.Message
The Message whose header values are being assigned.

ExceptionCondition
ArgumentNullException

message is null.

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


//
AddressHeader addressHeader5 = AddressHeader.CreateAddressHeader("specialservice5", "http://localhost:8000/service", 2);
EndpointAddress endpointAddress2 = new EndpointAddress(
    new Uri("http://localhost/silverlightsamples/service1"), addressHeader5
    );
Message message = Message.CreateMessage(MessageVersion.Soap11, null);
endpointAddress2.ApplyTo(message);
MessageHeaders messageHeaders = message.Headers;


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: