title: Why are the soap headers missing when using Custom MessageEncoder
body: <p>I am creating a custom message encoder similar to what you have in the WCF example projects(WF_WCF_Samples\WCF\Extensibility\MessageEncoder\Compression). </p>
  
  <p>The problem I am having is when sending a request, using the default textMessageEncoder with no compression produces this request after encoding.</p>
  
  <p><a href="https://i.stack.imgur.com/rEUeq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rEUeq.png" alt="enter image description here"></a></p>
  
  <p>However, when I am using my custom encoder with gzip compression and sending a request from soapUI this is what I get.</p>
  
  <p><a href="https://i.stack.imgur.com/ehWMv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ehWMv.png" alt="enter image description here"></a></p>
  
  <p>As you can see the <strong>To</strong> and <strong>Action</strong> are missing. It ends up giving me this exception.</p>
  
  <pre><code>The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 
  </code></pre>
  
  <p>This can be remedied by adding the following manually in the MessageEncoder</p>
  
  <pre><code>message.Headers.To = new Uri("http://localhost:19860/Service1.svc");
  message.Headers.Action = @"http://tempuri.org/IService1/GetData";
  </code></pre>
  
  <p>So my question is why is this happening? Why am I missing my headers when using the custom MessageEncoder even though I am just using the inner encoder to create the message?</p>
  
  <p>Here is the full solution. To test it you just need soap ui and send request to <a href="http://localhost:19860/Service1.svc" rel="nofollow noreferrer">http://localhost:19860/Service1.svc</a></p>
  
  <p><a href="https://github.com/janmchan/WCFCompression" rel="nofollow noreferrer">https://github.com/janmchan/WCFCompression</a></p>