Unable to implement behaviorExtensions in WCF

May 31, 2009 at 7:53 PM
Edited May 31, 2009 at 8:01 PM

Hi,

I implemented IDispatchMessageInspector, IClientMessageInspector as following:


        public object AfterReceiveRequest(ref Message request, IClientChannel channel,
            InstanceContext instanceContext)
        {
            request = TraceMessage(request.CreateBufferedCopy(int.MaxValue));
            return null;
        }

        public void BeforeSendReply(ref Message reply, object correlationState)
        {
            reply = TraceMessage(reply.CreateBufferedCopy(int.MaxValue));
        }

        #endregion

        #region IClientMessageInspector Members

        public void AfterReceiveReply(ref Message reply, object correlationState)
        {
            reply = TraceMessage(reply.CreateBufferedCopy(int.MaxValue));
        }

        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            request = TraceMessage(request.CreateBufferedCopy(int.MaxValue));
            return null;
        }

But any of these 4 funtions are never executed.

I am using WinXP Prof SP2, IIS 5.1, .NET framework 3.5 and VS2005.

Can any one help me out?