ISendMessageCallback Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An interface that implements a callback that is called just before a message is sent on the wire by the Send or SendParametersContent activities.
public interface class ISendMessageCallback
public interface ISendMessageCallback
type ISendMessageCallback = interface
Public Interface ISendMessageCallback
Examples
The following example shows how to implement the ISendMessageCallback interface to a new header to a message before it is sent out on the wire.
class SendInstanceIdCallback : ISendMessageCallback
{
public const string HeaderName = "InstanceIdHeader";
public const string HeaderNS = "http://Microsoft.Samples.AccessingOperationContext";
public Guid InstanceId { get; set; }
public void OnSendMessage(System.ServiceModel.OperationContext operationContext)
{
operationContext.OutgoingMessageHeaders.Add(MessageHeader.CreateHeader(HeaderName, HeaderNS, this.InstanceId));
}
}
Methods
OnSendMessage(OperationContext) |
Executed when a service message is sent. |
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET