EndpointAddress.ApplyTo Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Assigns the URI and properties of the endpoint address to the values of the headers of a specified message.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- message
- Type: System.ServiceModel.Channels.Message
The Message whose header values are being assigned.
| Exception | Condition |
|---|---|
| ArgumentNullException | message is Nothing. |
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".
' Dim addressHeader5 As AddressHeader = AddressHeader.CreateAddressHeader("specialservice5", "http://localhost:8000/service", 2) Dim endpointAddress2 As New EndpointAddress(New Uri("http://localhost/silverlightsamples/service1"), addressHeader5) Dim message As Message = Message.CreateMessage(MessageVersion.Soap11, Nothing) endpointAddress2.ApplyTo(message) Dim messageHeaders As MessageHeaders = message.Headers
Show: