R – Consuming Web Services in CF 2.0

compact-frameworkweb services

I made it work. However, there is a curious detail I noticed.

My Web Service is retrieving data from the database and returns a list of objects:

public List<RunResult> GetRunResults(string runno)

When called from the CF project it is shown that this web method returns RunResult[].
What gives?

am using CF 2.0 and the web service is also written in C#, asp.net 2.0

Best Answer

Web services never return a generic list. If you need one at the consumer side just do something like this:

List<RunResult> list = new List<RunResult>(GetRunResults());

or

List<RunResult> list = new List<RunResult>();
list.AddRange(GetRunResults());