title: Handling custom soap header in WCF Service
body: <p>I am creating WCF Service to receive a message (strings). It has soap request has header as shown below. I went thru so many example that I found on internet, but I could not understand any of those thoroughly. </p>
  
  <p>I found this article is very helpful but still could not make it works
  <strong><code>http://weblogs.asp.net/paolopia/handling-custom-soap-headers-via-wcf-behaviors</code></strong></p>
  
  <p>After reading several article, I come to know that I need to handle the following area (a)SOAP Header (b) Message Inspector (c) Client Context and (d) Server Context class</p>
  
  <ol>
  <li>How do I handle mustUnderstand header</li>
  <li>I need to capture value passed <code>messageid</code>, <code>ReplyTo</code>, <code>To</code>, <code>From</code>, <code>Action</code></li>
  </ol>
  
  <p><em>The following soap message need to be consumed</em></p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"&gt;
      &lt;soapenv:Header&gt;
      &lt;a:Action s:mustUnderstand="1"&gt;urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b&lt;/a:Action&gt;
      &lt;a:From&gt;&lt;a:Address&gt;urn:oid:1.2.3.4.5.6.1234567.10.70.142.2&lt;/a:Address&gt;
      &lt;/a:From&gt;
      &lt;a:MessageID&gt;urn:uuid:3a40ebfe-2abc-4de9-b6f6-06c7962f6050&lt;/a:MessageID&gt;
      &lt;a:ReplyTo&gt;
      &lt;a:Address&gt;http://www.w3.org/2005/08/addressing/anonymous&lt;/a:Address&gt;
      &lt;/a:ReplyTo&gt;
      &lt;a:To&gt;https://localhost/MyWCFService/Service.asmx&lt;/a:To&gt;
  &lt;/soapenv:Header&gt;
  </code></pre>
  
  <p>
  
           
              
  ...</p>