/// <summary>
 /// Called after the operation has returned but before the reply message is sent.
 /// </summary>
 /// <param name="reply">The reply message. This value is null if the operation is one way.</param>
 /// <param name="correlationState">The correlation object returned from the <see cref="M:System.ServiceModel.Dispatcher.IDispatchMessageInspector.AfterReceiveRequest(System.ServiceModel.Channels.Message@,System.ServiceModel.IClientChannel,System.ServiceModel.InstanceContext)"/> method.</param>
 public void BeforeSendReply(ref Message reply, object correlationState)
 {
     if (WulkaContext.Current != null)
     {
         MessageInspectorHelper.EncodeWulkaContext(WulkaContext.Current, ref reply);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Enables inspection or modification of a message before a request message is sent to a service.
 /// </summary>
 /// <param name="request">The message to be sent to the service.</param>
 /// <param name="channel">The  client object channel.</param>
 /// <returns>
 /// The object that is returned as the <paramref name="correlationState "/>argument of the <see cref="M:System.ServiceModel.Dispatcher.IClientMessageInspector.AfterReceiveReply(System.ServiceModel.Channels.Message@,System.Object)"/> method. This is null if no correlation state is used.The best practice is to make this a <see cref="T:System.Guid"/> to ensure that no two <paramref name="correlationState"/> objects are the same.
 /// </returns>
 public object BeforeSendRequest(ref Message request, IClientChannel channel)
 {
     return(MessageInspectorHelper.EncodeWulkaContext(ref request, channel));
 }