title: WCF - Error: The message version of the outgoing message (Soap12 (http://www.w3.org/2003/05/soap-envelope)
body: <p>1) I have WCF service deployed on local IIS 5.1:</p>
  
  <p>Interface:</p>
  
  <pre><code>[OperationContract(Action = Service.RequestAction, ReplyAction = Service.ReplyAction)]
  Message SetData(Message requestXml);
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>public const string ReplyAction = "http://localhost/AsurReceiveData/Message_ReplyAction";
  public const string RequestAction = "http://localhost/AsurReceiveData/Message_RequestAction";
  
  public Message SetData(Message requestXml)
  {
      using (StreamWriter writer = File.CreateText(@"E:\Projekti\WCF\Parus\AsurReplicData\Parus\Body.xml"))
      {
          writer.WriteLine(requestXml.ToString());
      }
      Message response = Message.CreateMessage(MessageVersion.Default, ReplyAction, requestXml.ToString());
  
      return response;
  }
  </code></pre>
  
  <p>Web.config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment&gt;
      &lt;baseAddressPrefixFilters&gt;
        &lt;add prefix="http://localhost:80/"/&gt;
      &lt;/baseAddressPrefixFilters&gt;
    &lt;/serviceHostingEnvironment&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="Parus.ServiceBehavior"&gt;
          &lt;serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost/AsurReceiveData/Service.svc"/&gt;
          &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
          &lt;MyInspector /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;services&gt;
      &lt;service behaviorConfiguration="Parus.ServiceBehavior" name="Parus.Service"&gt;
        &lt;endpoint address="http://localhost/AsurReceiveData/Service.svc" binding="basicHttpBinding" contract="Parus.IService"&gt;
        &lt;/endpoint&gt;
        &lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/&gt;
      &lt;/service&gt;
    &lt;/services&gt;
    &lt;extensions&gt;
      &lt;behaviorExtensions&gt;
        &lt;add name="MyInspector" type="Parus.MessageInspectorExtension, Parus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/&gt;
      &lt;/behaviorExtensions&gt;
    &lt;/extensions&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>2) The client side looks as following:</p>
  
  <pre><code>ServiceClient client = new ServiceClient();
  string RequestAction = "http://localhost/AsurReceiveData/Message_RequestAction";
  Message request = Message.CreateMessage(MessageVersion.Default, RequestAction, "Test message");
  Message reply = client.SetData(request);
  </code></pre>
  
  <p>Web.config:</p>
  
  <pre><code>&lt;binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
   openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
   allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
   maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
   messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
   useDefaultWebProxy="true"&gt;
   &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
   &lt;security mode="None"&gt;
    &lt;transport clientCredentialType="None" proxyCredentialType="None"
     realm="" /&gt;
    &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
   &lt;/security&gt;
  &lt;/binding&gt;
  &lt;endpoint address="http://localhost/AsurReceiveData/Service.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
    contract="ServiceReference.IService" name="BasicHttpBinding_IService" /&gt;
  </code></pre>
  
  <p>When I run the client, the following error message comes up:</p>
  
  <blockquote>
    <p>The message version of the outgoing message (Soap12 (http://www.w3.org/2003/05/soap-envelope) Addressing10 (http://www.w3.org/2005/08/addressing)) does not match that of the encoder (Soap11 (http://schemas.xmlsoap.org/soap/envelope/) AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)). Make sure the binding is configured with the same version as the message.</p>
  </blockquote>
  
  <p>How can I make it work?</p>