Phang Tingya

Phang Tingya

  • NA
  • 7
  • 768

Xamarin Form consuming asmx web service

Jan 11 2019 8:56 AM
I have a xamarin form application that consumes asmx web service. I have a web method that returns a List<class>. However, I encounter error in the class declared under Xamarind Droid to implement the interface. Below is my code:
 
public async Task<List<IProject>> GetAllProjects(string criteria = null)
{
return await Task.Run(() =>
{
var result = service.GetAllProjects();
return new List<IProject>(result);
});
}
 
The error is with "return new List<IProject>(result);". Error:CS1503 Argument 1: cannot convert from 'IMSr2.Droid.IMSWS.Project[]' to 'int'.
** service.GetAllProjects(): this is the webmethod.
How should I return class result from the web service?