title: Unable to make IDispatchMessageInspector work
body: <p>I need to play with request header in a REST, Json, WCF web service.
  I create my IDispatchMessageInspector</p>
  
  <pre><code>public class HeaderInspector : IDispatchMessageInspector
  {
      public object AfterReceiveRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel, System.ServiceModel.InstanceContext instanceContext)
      {
          int ind = request.Headers.FindHeader("xxxxx", "");
          return null;
      }
  
      public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
      {
      }
  }
  </code></pre>
  
  <p>Then a endpointbehavio to attach the inspector to endpoints :</p>
  
  <pre><code>public class HeaderInspectorBehavior : IEndpointBehavior
  {
      public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
      {
      }
  
      public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
      {
      }
  
      public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
      {
          HeaderInspector headerinsp = new HeaderInspector();
          endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new HeaderInspector());
      }
  
      public void Validate(ServiceEndpoint endpoint)
      {
      }
  }
  </code></pre>
  
  <p>And finally a BehaviorExtensionElement : </p>
  
  <pre><code>public class MyExtension : BehaviorExtensionElement
  {
      public override Type BehaviorType
      {
          get { return typeof(HeaderInspectorBehavior); }
      }
      protected override object CreateBehavior()
      {
          return new HeaderInspectorBehavior();
      }
  }
  </code></pre>
  
  <p>Those classes being in the same file / namespace PDM.WebService
  My config is :</p>
  
  <pre><code>&lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="RestBehavior"&gt;
        &lt;HeaderInspectorBehavior/&gt;
        &lt;webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json" faultExceptionEnabled="true" automaticFormatSelectionEnabled="false" /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;extensions&gt;
    &lt;behaviorExtensions&gt;
      &lt;add name="HeaderInspectorBehavior" type="PDM.WebService.MyExtension, PDM.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /&gt;
    &lt;/behaviorExtensions&gt;
  &lt;/extensions&gt;
  </code></pre>
  
  <p>Everything compile well, at execution i can catch the execution of method "public override Type BehaviorType", 
  but no other methods of the code are fired after that (i sent request and i got response, the service respond well). 
  i set debug point in every methods nothing else execute ! (especially ApplyDispatchBehavior).
  Can somebody point out what i'm missing ?</p>