I want to return a list of some resources from a web service. The web service seems to make the list return as an array.
The next three lines work part of the array, but I canโt figure out how to get it back to a list like "InventoryToSync"
List<InventoryToSync> inventoryList = new List<InventoryToSync>(); Array theArray = myIcsSyncService.ReturnInventoryToSyncDictionary(); inventoryList = myIcsSyncService.ReturnInventoryToSyncDictionary().Cast<InventoryToSync>();
Here is my web method:
[WebMethod] [System.Xml.Serialization.XmlInclude(typeof(InventoryToSync))] public List<InventoryToSync> ReturnInventoryToSyncDictionary() { Inventory inventory = new Inventory(); return inventory.GetInventoryList(); }
I tried to force the type to be entered using XmlInclude, but still do not go.
How to get a web service to return a list of my InventoryToSync or how to convert an array back to Inventory to Sync.
pStan source share