title: SOAP message deserialization issue in WCF - fields have null values
body: <p>Here's my service contract:</p>
  
  <pre><code>[ServiceContract(Namespace = Service.Namespace)]
  [XmlSerializerFormat(Style=OperationFormatStyle.Document, Use=OperationFormatUse.Literal)]
  public interface IService
  {
      [OperationContract]
      UpdateResponse Update(UpdateRequest request);
  }
  </code></pre>
  
  <p>The implementation:</p>
  
  <pre><code>[ServiceBehavior(Namespace = Namespace)]
  public class Service : IService
  {
      public const string Namespace = "http://schemas.localhost.net/test";
  
      public UpdateResponse Update(UpdateRequest request)
      {
          return new UpdateResponse() { Succeeded = true };
      }
  }
  </code></pre>
  
  <p>The message contracts:</p>
  
  <pre><code>[MessageContract(WrapperNamespace = Service.Namespace)]
  public class UpdateRequest
  {
      [MessageBodyMember]
      public int Id { get; set; }
      [MessageBodyMember]
      public string Name { get; set; }
  }
  
  [MessageContract(WrapperNamespace = Service.Namespace)]
  public class UpdateResponse
  {
      [MessageBodyMember]
      public bool Succeeded { get; set; }
  }
  </code></pre>
  
  <p>The web.config file (a part of it):</p>
  
  <pre><code>&lt;services&gt;
    &lt;service behaviorConfiguration="returnFaults" name="ServiceTest.Service"&gt;
      &lt;endpoint binding="basicHttpBinding" contract="ServiceTest.IService" 
                bindingNamespace="http://schemas.localhost.net/test" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  </code></pre>
  
  <p>And here is the soap message (request) sent from fiddler:</p>
  
  <pre><code>POST http://localhost:10000/Service.svc HTTP/1.1
  SOAPAction: "http://schemas.localhost.net/test/IService/Update"
  Content-Type: text/xml; charset="utf-8"
  Host: localhost:10000
  Content-Length: 532
  
  &lt;?xml version="1.0"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
  &lt;SOAP-ENV:Body xmlns:NS1="http://schemas.localhost.net/test"&gt;       
      &lt;NS1:UpdateRequest id="1"&gt;  
          &lt;Name xsi:type="xsd:string"&gt;Abcdefg&lt;/Name&gt;&lt;Id xsi:type="xsd:int"&gt;1&lt;/Id&gt;
      &lt;/NS1:UpdateRequest&gt;
      &lt;parameters href="#1"/&gt;
  &lt;/SOAP-ENV:Body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Update() operation receives an UpdateRequest object, but <strong>the fields are not set (Name is null, Id is zero)</strong>. The response is ok, though.</p>