title: Using IDispatchMessageInspector to get request's remote address
body: <p>I'm trying to follow this blog post: <a href="http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx" rel="nofollow">http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx</a></p>
  
  <p>My aim is to somehow get the remote address of the incoming request, but for some reason the address either is nowhere to be seen in any of the parameters, or is null.</p>
  
  <p>Here's the interface I'm implementing:</p>
  
  <pre><code>public interface IDispatchMessageInspector
  {
      object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext);
      void BeforeSendReply(ref Message reply, object correlationState);
  }
  </code></pre>
  
  <p>The method I'm trying to get the remote address in is <code>AfterReceiveRequest</code>. I've checked both parameters <code>request</code> and <code>channel</code>. Also, it seems that <code>channel.RemoteAddress</code> is where it should be, but that property is null for some reason. The <code>request</code> parameter is also null, but I'm guessing that's because I'm doing a GET and not a POST.</p>
  
  <p>Below is the signature of the method I'm invoking to test this out.</p>
  
  <pre><code>[OperationContract, WebGet( UriTemplate = "{*path}", ResponseFormat = WebMessageFormat.Json)]
  string[] GetList(string path);
  </code></pre>