title: Returning a List of type from web service
body: <p>I want to return a list of some inventory from a web service.  It seems that the web service forces the the list to return as an array.</p>
  
  <p>In the following 3 lines the array portion works, but I can't figure out how to cast it back to a list of type "InventoryToSync"</p>
  
  <pre><code>List&lt;InventoryToSync&gt; inventoryList = new List&lt;InventoryToSync&gt;();
  Array theArray = myIcsSyncService.ReturnInventoryToSyncDictionary();
  inventoryList = myIcsSyncService.ReturnInventoryToSyncDictionary().Cast&lt;InventoryToSync&gt;();
  </code></pre>
  
  <p>Here is my web method:</p>
  
  <pre><code>    [WebMethod]
      [System.Xml.Serialization.XmlInclude(typeof(InventoryToSync))]
      public List&lt;InventoryToSync&gt; ReturnInventoryToSyncDictionary()
      {
          Inventory inventory = new Inventory();
  
          return inventory.GetInventoryList();
      }
  </code></pre>
  
  <p>I tried to force the type with XmlInclude, but still no go.</p>
  
  <p>How to I force the web service to return a list of my InventoryToSync, or how do I convert the array back to Inventory to Sync.</p>