Ejemplo n.º 1
0
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     for (int i = 0; i < serviceHostBase.ChannelDispatchers.Count; i++)
     {
         var channelDispatcher = serviceHostBase.ChannelDispatchers[i] as ChannelDispatcher;
         if (channelDispatcher != null)
         {
             foreach (var endpointDispatcher in channelDispatcher.Endpoints)
             {
                 //register LoggerMessageInspector object to WCF message inspectors
                 var inspector = new LoggerMessageInspector();
                 endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
             }
         }
     }
 }
        public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
            var inspector = new LoggerMessageInspector();

            endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
        }