title: asp.net web services returning empty object
body: <p>I have an XSD file which determines the schema by which my engine can communicate to other  plugins (written in different languages, like Delphi). I used the XSD tool provided by .Net to get a C# class out of the XSD file. </p>
  
  <p>The plugins return an XML string which I then de-serialize into an the class generated by the XSD tool.</p>
  
  <p>Everything's fine up till there, however when I pass an array of the class through a web service to the client, the array contains one element, which is fine, but every field in that object is either null or set to its default value.</p>
  
  <p>Any ideas Why this could be happening ?</p>
  
  <p>I also tried sending dummy data instead of retrieving the data from the plugin normally but still the object returned is empty.</p>
  
  <p>This is the Class generated by the XSD tool:</p>
  
  <pre><code>using System.Xml.Serialization;
  
  
  /// &lt;remarks/&gt;
  [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
  public class BookingQueryResponse {
  
      /// &lt;remarks/&gt;
      public int ErrorCode;
  
      /// &lt;remarks/&gt;
      public string ErrorString;
  
      /// &lt;remarks/&gt;
      public int BookingQueryID;
  
      /// &lt;remarks/&gt;
      public int DestinationID;
  
      /// &lt;remarks/&gt;
      public string DestinationName;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(DataType="date")]
      public System.DateTime ArrivalDate;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(DataType="date")]
      public System.DateTime DepartureDate;
  
      /// &lt;remarks/&gt;
      public int CurrencyID;
  
      /// &lt;remarks/&gt;
      public string CurrencyISO;
  
      /// &lt;remarks/&gt;
      public string CurrencySymbol;
  
      /// &lt;remarks/&gt;
      public int LangID;
  
      /// &lt;remarks/&gt;
      public string LangCode;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("HotelQuotePackages")]
      public HotelQuotePackage[] HotelQuotePackages;
  }
  
  /// &lt;remarks/&gt;
  public class HotelQuotePackage {
  
      /// &lt;remarks/&gt;
      public string PackageGuid;
  
      /// &lt;remarks/&gt;
      public string PackageName;
  
      /// &lt;remarks/&gt;
      public string PluginGuid;
  
      /// &lt;remarks/&gt;
      public int ResortID;
  
      /// &lt;remarks/&gt;
      public string ResortName;
  
      /// &lt;remarks/&gt;
      public int HotelID;
  
      /// &lt;remarks/&gt;
      public string HotelName;
  
      /// &lt;remarks/&gt;
      public int HotelRatingID;
  
      /// &lt;remarks/&gt;
      public string HotelRatingName;
  
      /// &lt;remarks/&gt;
      public string HotelNarrative;
  
      /// &lt;remarks/&gt;
      public System.Double MapLongitude;
  
      /// &lt;remarks/&gt;
      public System.Double MapLatitude;
  
      /// &lt;remarks/&gt;
      public string HotelRemark;
  
      /// &lt;remarks/&gt;
      public string OfferText;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("HotelRoomQuotes")]
      public HotelRoomQuote[] HotelRoomQuotes;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("HotelImages")]
      public HotelMediaImage[] HotelImages;
  }
  
  /// &lt;remarks/&gt;
  public class HotelRoomQuote {
  
      /// &lt;remarks/&gt;
      public int RoomNumber;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("RoomQuotes")]
      public RoomQuote[] RoomQuotes;
  }
  
  /// &lt;remarks/&gt;
  public class RoomQuote {
  
      /// &lt;remarks/&gt;
      public string Guid;
  
      /// &lt;remarks/&gt;
      public int AdultPax;
  
      /// &lt;remarks/&gt;
      public int ChildPax;
  
      /// &lt;remarks/&gt;
      public int InfantPax;
  
      /// &lt;remarks/&gt;
      public string RoomTypeName;
  
      /// &lt;remarks/&gt;
      public string RoomTypeDesc;
  
      /// &lt;remarks/&gt;
      public int BoardBasisID;
  
      /// &lt;remarks/&gt;
      public string BoardBasisName;
  
      /// &lt;remarks/&gt;
      public System.Double CostForStay;
  
      /// &lt;remarks/&gt;
      public string Remarks;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("DayRates")]
      public DayRate[] DayRates;
  }
  
  /// &lt;remarks/&gt;
  public class DayRate {
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute(DataType="date")]
      public System.DateTime Date;
  
      /// &lt;remarks/&gt;
      public System.Double Rate;
  }
  
  /// &lt;remarks/&gt;
  public class HotelMediaImage {
  
      /// &lt;remarks/&gt;
      public string HotelImage;
  
      /// &lt;remarks/&gt;
      public int ImageTypeID;
  
      /// &lt;remarks/&gt;
      public string ImageType;
  }
  </code></pre>
  
  <p>and just for testing purposes the web Service all I did is this:</p>
  
  <pre><code>return return new BookingQueryResponse[1] { new BookingQueryResponse() { ArrivalDate = DateTime.Now.Date, DestinationName = "Malta" } };
  </code></pre>