예제 #1
0
        /// <summary>
        /// Enables inspection or modification of a message after a reply message is
        /// received but prior to passing it back to the client application
        /// </summary>
        /// <param name="reply"></param>
        /// <param name="correlationState"></param>
        public void AfterReceiveReply(ref Message reply, object correlationState)
        {
            MessageBuffer buffer = reply.CreateBufferedCopy(Int32.MaxValue);

            var requestCopy = buffer.CreateMessage();

            var messageLog = new MessageInspectorLogger();

            messageLog.Log(requestCopy);

            reply = buffer.CreateMessage();

            buffer.Close();
        }
예제 #2
0
        /// <summary>
        /// Enables inspection or modification of a message before a request message is
        /// sent to a service
        /// </summary>
        /// <param name="request"></param>
        /// <param name="channel"></param>
        /// <returns></returns>
        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue);

            var requestCopy = buffer.CreateMessage();

            var messageLog = new MessageInspectorLogger();

            messageLog.Log(requestCopy);

            request = buffer.CreateMessage();

            buffer.Close();

            return(null);
        }