I’m trying to create and consume a web service… I’m using .NET Framework 4.0 (c#).
The service exposes a method like this:
public List<object[]> GetData(string strRegion, List<string> lstBrand, List<string> lstColor)
Then on the client application, I declare a list of objects:
List<object[]> lst = new List<object[]>();
… and attempt to fill it like so:
MyService.MyClient os = new MyClient();
lst = os.GetData(myRegionString, myBrandList, myColorList);
… but I get, “Cannot implicity convert type ‘object[][]’ to ‘System.Collections.Generic.List'”. What am I doing wrong?
Thanks!
In the solution explorer, right click your service and do configuration. You may have set the data collection default type to array. You can set it to be a list type. Also, I would rethink sending an
objectover a web service. You typically want a well defined data type. I don’t think you can even send typeobjectover a web service.