ApplyTo Method
Collapse the table of content
Expand the table of content

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.

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

'Declaration
Public Sub ApplyTo ( _
	message As Message _
)

Parameters

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

ExceptionCondition
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


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft