title: Soap Serializer does not support serializing Generic Types
body: <p>I have encountered an error, while trying to create soap message in C# Class.</p>
  
  <p><strong>Booking Class-</strong></p>
  
  <pre><code>public class GuestDetails
      {
          public string GuestTitle { get; set; }
          public string GuestName { get; set; }
          public string Address1 { get; set; }
          public string Address2 { get; set; }
          public string Address3 { get; set; }
          public string Pincode { get; set; }
          public string Country { get; set; }
          public string Nationality { get; set; }
          public string EmailId { get; set; }
          public string PhoneNo { get; set; }
      }
  
      public class BookingDetails
      {
          public string BookingNumber { get; set; }
          public string BookingDate { get; set; }
          public string Bookedby { get; set; }
          public string OTAId { get; set; }
          public string OTAName { get; set; }
          public string BookingStatus { get; set; }
          public string CheckinDate { get; set; }
          public string CheckinTime { get; set; }
          public string CheckoutDate { get; set; }
          public string CheckoutTime { get; set; }
      }
  
      public class RoomingDetail
      {
          public string RoomTypeId { get; set; }
          public string RateId { get; set; }
          public string NoOfRooms { get; set; }
          public string Adult { get; set; }
          public string Children { get; set; }
          public string NoOfExtrabed { get; set; }
          public string MealPlan { get; set; }
      }
  
      public class Hotel
      {
          public string hotelid { get; set; }
          public GuestDetails GuestDetails { get; set; }
          public BookingDetails BookingDetails { get; set; }
          public List&lt;RoomingDetail&gt; RoomingDetails { get; set; }
      }
  
      [Serializable]
      public class RootObject
      {
          public string accessKey { get; set; }
          public string channelId { get; set; }
          public List&lt;Hotel&gt; hotels { get; set; }
      }
  </code></pre>
  
  <p><strong>Converting C# class to Soap -</strong> </p>
  
  <pre><code>    RootObject R = new RootObject();
      R.accessKey = "";
      R.channelId = "";
      R.hotels = new List&lt;Hotel&gt;();
      Hotel _hotel = new Hotel();
      _hotel.hotelid = "3";
      _hotel.GuestDetails = new GuestDetails();
      _hotel.GuestDetails.GuestName = "GuestName";
      _hotel.GuestDetails.GuestTitle = "GuestTitle";
      _hotel.GuestDetails.Nationality = "Nationality";
      _hotel.GuestDetails.PhoneNo = "PhoneNo";
      _hotel.GuestDetails.Pincode = "Pincode";
      _hotel.GuestDetails.Address1 = "Address1";
      _hotel.GuestDetails.Address2 = "Address2";
      _hotel.GuestDetails.Address3 = "Address3";
      _hotel.GuestDetails.Country = "Country";
      _hotel.GuestDetails.EmailId = "EmailId";
      _hotel.RoomingDetails = new List&lt;RoomingDetail&gt;();
      RoomingDetail _roomingDetails = new RoomingDetail();
      _roomingDetails.Adult = "1";
      _roomingDetails.Children = "2";
      _roomingDetails.MealPlan = "sds";
      _roomingDetails.NoOfExtrabed = "";
      _roomingDetails.NoOfRooms = "1";
      _roomingDetails.RateId = "222";
      _roomingDetails.RoomTypeId = "11";
      _hotel.RoomingDetails.Add(_roomingDetails);
  
      _hotel.BookingDetails = new BookingDetails();
      //BookingDetails _bookingDetails = new BookingDetails();
      _hotel.BookingDetails.Bookedby = "Jagadees";
      _hotel.BookingDetails.BookingDate = "05-08-2014";
      _hotel.BookingDetails.BookingNumber = "15999";
      _hotel.BookingDetails.BookingStatus = "Success";
      _hotel.BookingDetails.CheckinDate = "03-09-2014";
      _hotel.BookingDetails.CheckinTime = "";
      _hotel.BookingDetails.CheckoutDate = "05-09-2014";
      _hotel.BookingDetails.CheckoutTime = "";
      _hotel.BookingDetails.OTAId = "";
      _hotel.BookingDetails.OTAName = "";
  
  
  
      R.hotels.Add(_hotel);
  
      var r = new Random();
      SoapFormatter formatter = new SoapFormatter();
  
      string myTempFile = Path.Combine(Path.GetTempPath(), r.Next() + "SaveFile.txt");
  
      GC.SuppressFinalize(myTempFile);
  
      Stream objfilestream = new FileStream(myTempFile, FileMode.Create, FileAccess.Write, FileShare.None);
      formatter.Serialize(objfilestream, R); &lt;-- ERROR HERE --&gt;
      objfilestream.Close();
  </code></pre>
  
  <p><strong>Error -</strong></p>
  
  <blockquote>
    <p>SerializationException was ungandled by user code
    Soap Serializer does not support serializing Generic Types :
    System.Collections.Generic.List`1[SoapwbApp.Hotel].</p>
  </blockquote>