title: WCF MustUnderstand headers are not understood
body: <p>I am using a Java Web Service which is developed by one of our vendor which I really do not have any control over it. I have  written a WCF router which the client application calls it and the router sends the message to the Java Web Service and returns the data back to the client. </p>
  
  <p>The issue what I am encountering is, I am successfully able to call the Java web service from the WCF router, but, I am getting the following exceptions back.</p>
  
  <p>Router config file is as follows:</p>
  
  <pre><code>&lt;customBinding&gt;
      &lt;binding name="SimpleWSPortBinding"&gt;
        &lt;!--&lt;reliableSession maxPendingChannels="4" maxRetryCount="8" ordered="true" /&gt;--&gt;
        &lt;!--&lt;mtomMessageEncoding messageVersion ="Soap12WSAddressing10" &gt;&lt;/mtomMessageEncoding&gt;--&gt;
        &lt;textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
        messageVersion="Soap12WSAddressing10" writeEncoding="utf-8" /&gt;
  
        &lt;httpTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                                        allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="true" keepAliveEnabled="true"
                                        maxBufferSize="65536" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"/&gt;
      &lt;/binding&gt;
    &lt;/customBinding&gt;
  </code></pre>
  
  <p>Test client config file </p>
  
  <pre><code>&lt;customBinding&gt;
              &lt;binding name="DocumentRepository_Binding_Soap12"&gt;
                &lt;!--&lt;reliableSession maxPendingChannels="4" maxRetryCount="8" ordered="true" /&gt;--&gt;
                &lt;!--&lt;mtomMessageEncoding messageVersion ="Soap12WSAddressing10" &gt;&lt;/mtomMessageEncoding&gt;--&gt;
  
                &lt;textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                      messageVersion="Soap12WSAddressing10" writeEncoding="utf-8"&gt;
                      &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                  &lt;/textMessageEncoding&gt;
  
                  &lt;httpTransport manualAddressing="false" maxBufferPoolSize="524288"
                      maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
                      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
                      realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                      useDefaultWebProxy="true" /&gt;
              &lt;/binding&gt;
          &lt;/customBinding&gt;
  </code></pre>
  
  <p>If I use the textMessageEncoding I am getting </p>
  
  <pre><code>&lt;soap:Text xml:lang="en"&gt;MustUnderstand headers: [{http://www.w3.org/2005/08/addressing}To, {http://www.w3.org/2005/08/addressing}Action] are not understood.&lt;/soap:Text&gt;     
  </code></pre>
  
  <p>If I use mtomMessageEncoding I am getting</p>
  
  <pre><code>The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
  </code></pre>
  
  <p>My Router class is as follows:</p>
  
  <pre><code> [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple, AddressFilterMode = AddressFilterMode.Any, ValidateMustUnderstand = false)]
  public class EmployeeService : IEmployeeService
  {
      public System.ServiceModel.Channels.Message ProcessMessage(System.ServiceModel.Channels.Message requestMessage)
      {
  
          ChannelFactory&lt;IEmployeeService&gt; factory = new ChannelFactory&lt;IEmployeeService&gt;("client");
  
          factory.Endpoint.Behaviors.Add(new MustUnderstandBehavior(false));
  
          IEmployeeService proxy = factory.CreateChannel();
  
          Message responseMessage = proxy.ProcessMessage(requestMessage);
  
          return responseMessage;
      }
  }
  </code></pre>
  
  <p>The "client" in the above code under ChannelFactory is defined in the config file as:</p>
  
  <pre><code> &lt;client&gt;
    &lt;endpoint address="http://JavaWS/EmployeeService" binding="wsHttpBinding"
        bindingConfiguration="wsHttp" contract="EmployeeService.IEmployeeService"
        name="client" behaviorConfiguration="clientBehavior"&gt;
      &lt;headers&gt;          
      &lt;/headers&gt;
    &lt;/endpoint&gt;
  &lt;/client&gt;
  </code></pre>
  
  <p>Really appreciate your kind help.</p>
  
  <p>Thanks in advance,
  Raghu</p>