I am trying to call a simple Login function in WCF service from Xamarin Forms.
I have referenced the service with no problems.
I have defined the client object like this:
Service1Client client = new Service1Client();
My service function name is Login and returns a String. Here is the definition:
Public Function Login(ByVal wUser As String, ByVal wPassword As String) As String Implements IService1.Login
Return String.Format("Test")
End Function
When I try to call that function from Xamarin Forms ServiceClient object I only have access to LoginAsync function instead of Login. Researching a bit I saw that I have to use await with async functions.
I tried that but then the line displays an error "Can't use await with void":
await client.LoginAsync("user", "password");
What I am doing wrong?
If I remove the await statement the WCF functions executes correctly and returns the "Test" string, but I do not know how to retrieve that on Xamarin Forms.
How can I retrieve the string that the function is trying to return?
Thank you.