title: WCF doesn't serialize all properties
body: <p>I'm consuming a SOAP service that has been imported as a Service Reference in VS2010. I call one of the services with a request object that is provided by the service. The problem I'm having is that not all properties of the object are serialized, or rather not sent over the wire. The request object looks like this:</p>
  
  <pre><code>var serviceRequest = new UpdateRequest{
      StoreId = request.StoreId,
      Id = request.Id,
      Status = (Status)Enum.Parse(typeof(Status), request.myStatus.ToString()),
      parameters = request.Parameters,
      validFrom = request.ValidFrom.Value,
      validFromSpecified = request.ValidFromSpecified
  };
  </code></pre>
  
  <p>And here is what is sent over the wire. I've captured it with wireshark</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;updateStore xmlns="http://localhost.service.com/"&gt;
      &lt;StoreRequest&gt;
      &lt;StoreId&gt;1234&lt;/StoreId&gt;
      &lt;validFrom&gt;2011-11-29T00:00:00&lt;/validFrom&gt;
      &lt;parameters&gt;
          &lt;param1&gt;true&lt;/param1&gt;
      &lt;/parameters&gt;
      &lt;/StoreRequest&gt;
  &lt;/updateStore&gt;
  &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>Two of the parameters, Id and Status have not been sent to the service, and I just can't figure out why. The values are being set and the WSDL generated properties are public and have the same serialization attributes as the properties that are being serialized.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Edit----
  Updated with service reference generated code</p>
  
  <pre><code>/// &lt;remarks/&gt;
  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://myservice.com/")]
  public partial class StoreUpdateRequest : object,        
  System.ComponentModel.INotifyPropertyChanged {
      private long StoreIdField;        
      private long IdField;        
      private bool IdFieldSpecified;        
      private Status StatusField;        
      private bool StatusFieldSpecified;        
      private long storeIdField;        
      private bool storeIdFieldSpecified;        
      private System.DateTime validFromField;        
      private bool validFromFieldSpecified;        
      private System.DateTime validToField;        
      private bool validToFieldSpecified;        
      private technicalParameters parametersField;        
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Order=0)]
      public long StoreId {
          get {
              return this.StoreIdField;
          }
          set {
              this.StoreIdField = value;
              this.RaisePropertyChanged("StoreId");
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(Order=1)]
      public long Id {
          get {
              return this.IdField;
          }
          set {
              this.IdField = value;
              this.RaisePropertyChanged("Id");
          }
      }
  </code></pre>