I have a xamarin form apps and I need it to consume an asmx web service. I encounter error when creating class in Android platform to implement the interface.
I have following this tutorial (https://www.c-sharpcorner.com/article/consuming-asmx-services-in-xamarin-forms/) to consume the asmx web service. I have this web method called "GetAllProjects" which will return List. I keep encounter error for the line of code: "return new List(result);" (refer to the codes below).
Error message: Error CS1503 Argument 1: cannot convert from 'IMSr2.Droid.IMSWS.Project[]' to 'int'. How should I return the result from the web service?
public async Task<List<IProject>> GetAllProjects(string criteria = null)
{
return await Task.Run(() =>
{
var result = service.GetAllProjects();
return new List<IProject>(result);
/* How should I return the result from the web service?*/
});
}
/* This hello world is working*/
public Task<string> HelloWorld()
{
return Task.Run(() =>
{
return service.HelloWorld();
});
}
I am expecting the same result as the tutorial: https://www.c-sharpcorner.com/article/consuming-asmx-services-in-xamarin-forms/ I need to return the result from the webservice call ("GetAllProjects") and display in the listview. Appreciate for help.