IDispatchMessageInspector.BeforeSendReply Method (Message, Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Called after the operation has returned but before the reply message is sent.

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

abstract BeforeSendReply : 
        reply:Message byref *
        correlationState:Object -> unit

Parameters

reply
Type: System.ServiceModel.Channels.Message

The reply message. This value is null if the operation is one way.

correlationState
Type: System.Object

The correlation object returned from the AfterReceiveRequest method.

Use the BeforeSendReply method to perform custom behavior prior to sending the return message. The correlationState is the object returned from the AfterReceiveRequest method that you can use to perform correlation between inbound and outbound calls to support your behavior.

The following code example shows a basic IDispatchMessageInspector that writes a string to the console when it is invoked.

No code example is currently available or this language may not be supported.

The following code example shows the implementation of an IServiceBehavior that adds the InspectorIDispatchMessageInspector to the DispatchRuntime.MessageInspectors collection.

No code example is currently available or this language may not be supported.

The following code example shows the use of an application configuration file to load the service behavior that inserts the InspectorIDispatchMessageInspector.

.NET Framework
Available since 3.0
Return to top
Show: