Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDispatchMessageInspector::BeforeSendReply Method (Message^%, Object^)

 

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

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

void BeforeSendReply(
	Message^% reply,
	Object^ correlationState
)

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:
© 2017 Microsoft