I have a web service that when invoked, returns a Result object that contains a List polymorphically. However, when I add a reference in my client application, the public field becomes an array of Country in the client application. How do I change the field in the client application to List?
public Result GetCountryList()
{
List<Country> countries = GrabCountryList();
Result result = new Result();
result.theResult = countries;
}
and this is the public property
public object theResult
{
get {return _theResult; }
set {_theResult = value;}
}
Accepted answer from Mehmet Aras:
Right click on the service reference, and select "Configure Reference". Under Collection type, select System.Collection.Generic.List. Update the service reference, and it should be good to go.
Thanks to Matt Hamilton for the suggestion to create a new list from the array.