title: Remove Action Node mustUnderstand from WCF soap request using IClientMessageInspector
body: <p>I am hitting a WCF service using a WSDL I don't have access to and cannot modify. For one of the requests the remote service is dying because we are sending the: </p>
  
  <pre><code>&lt;Action s:mustUnderstand="1"....&gt;
  </code></pre>
  
  <p>Having searched extensively I cannot find a simple solution to my problem. So, 
  in a typical message:</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;s:Header&gt;
      &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none" /&gt;
    &lt;/s:Header&gt;
    &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;retrieveBooking xmlns="http://services.rccl.com/Interfaces/RetrieveBooking"&gt;
        &lt;OTA_ReadRQ TransactionActionCode="RetrievePrice" SequenceNmbr="1" Version="1" xmlns="http://www.opentravel.org/OTA/2003/05/alpha"&gt;
  </code></pre>
  
  <p>I figured I could remove this node as part of message inspector:</p>
  
  <pre><code>internal class MyMessageInspector : IClientMessageInspector
  {
     public object BeforeSendRequest(ref Message aRequest, IClientChannel aChannel)
     {
          //Get rid of mustUnderstand Action node
          foreach (MessageHeaderInfo headerInfo in aRequest.Headers.UnderstoodHeaders)
          {
              aRequest.Headers.UnderstoodHeaders.Remove(headerInfo);
          }
  
          return null;
     }
  } 
  </code></pre>
  
  <p>however even though the aRequest.Headers.UnderstoodHeaders is empty after I remove all the elements, I am still seeing the Action node being emitted in the XML.</p>
  
  <ol>
  <li>What do I have to do to make this work? </li>
  <li>How do I get at the
  message contents so that I can inspect the name of the first node of
  the body tag <strong>retrieveBooking</strong> in this case? (I only need to do
  this for a specific message, not all of them)</li>
  </ol>