IDispatchMessageInspector::BeforeSendReply Method (Message^%, Object^)
Called after the operation has returned but before the reply message is sent.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
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.
The following code example shows the implementation of an IServiceBehavior that adds the InspectorIDispatchMessageInspector to the DispatchRuntime::MessageInspectors collection.
The following code example shows the use of an application configuration file to load the service behavior that inserts the InspectorIDispatchMessageInspector.
Available since 3.0