I added a method to a .Net 3.5 WCF web service that returns a DataTable. Other methods in the web service return Generic lists and/or take Generic lists as parameters.
When I update my reference to the altered web service from my client application all generic lists used as parameters or return types from all methods in the web service are converted to arrays.
In my service reference settings I have selected "System.Collections.Generic.List." Apparently this setting has no effect when a web service returns a DataTable?
Is there any way to prevent this from occuring?
Steps to reproduce:
Create a web service with methods that return Generic lists and/or take Generic lists as parameters.
In a client application reference the web service and select "System.Collections.Generic.List" as the collection type. Verify that return types/parameter types are generic lists.
Add a method to the web service that returns a DataTable. In a client application update the service reference. Note that all Generic lists (either as return types or method parameters) have changed to arrays. This occurs even though the collection type service reference setting remains as "System.Collections.Generic.List".
View Complete Post