title: How do I consume a WCF service that receives a strongly-typed object as input?
body: <p>I'm a newbie with WCF. I just followed a simple walkthrough to create and consume a simple WCF service (the walkthrough uses a string data type). However, I'm not able to consume a WCF service with a custom type. Here's what I tried:</p>
  
  <p>First, I created the interface.</p>
  
  <pre><code>[DataContract]
      public class TicketInfo
      {
          public string TicketID { get; set; }
          public string TicketDescription { get; set; }
      }
  
      [OperationContract]
      String GetTicketInfo(TicketInfo ticketInfo);
  </code></pre>
  
  <p>I then created the method in the service that implements the interface:</p>
  
  <pre><code>public string GetTicketInfo(TicketInfo ticketInfo)
  {
      return string.Format("The ID is {0}", ticketInfo.TicketID);
  }
  </code></pre>
  
  <p>I then added the Service Reference on the client.</p>
  
  <p>Now, I'm trying to consume the service:</p>
  
  <pre><code>    Service1Client client = new Service1Client();
  
          string returnString;
          TicketInfo ticketInfo = new TicketInfo();
          ticketInfo.ID = "1";
          returnString = client.GetTicketInfo(ticketInfo);
  </code></pre>
  
  <p>The code fails here:</p>
  
  <blockquote>
  <pre><code>        ticketInfo.TicketID = "1";
  </code></pre>
  </blockquote>
  
  <p>The error message is: </p>
  
  <blockquote>
    <p>'Ticketnfo' does not contain a definition for 'TicketID' and no extension
    method 'TicketID' accepting a first argument of type 'TicketInfo' could be
    found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Going to the definition of TicketInfo on the client shows:</p>
  
  <pre><code>public partial class TicketInfo : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
  
  [System.NonSerializedAttribute()]
  private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
  
  [global::System.ComponentModel.BrowsableAttribute(false)]
  public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
      get {
          return this.extensionDataField;
      }
      set {
          this.extensionDataField = value;
      }
  }
  </code></pre>
  
  <p>Why doesn't ServiceReference1.TicketInfo on the client have all the properties of Service1.TicketInfo on the server? How can I consume the service?</p>