예제 #1
0
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, System.ServiceModel.ServiceHostBase serviceHostBase)
 {
     foreach (var t in serviceHostBase.ChannelDispatchers)
     {
         ChannelDispatcher channelDispatcher = t as ChannelDispatcher;
         if (channelDispatcher != null)
         {
             foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints)
             {
                 MessageInspector inspector = new MessageInspector();
                 endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
             }
         }
     }
 }
예제 #2
0
        public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
            MessageInspector inspector = new MessageInspector();

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