Hi all,
I've tried fixing this for the last couple of days and I've finally given in as I can't find the answer.
I've set up a WCF Web Service and hosted it on IIS. I've tested the Web Service using Fiddler and it works fine (sends back a 200 and a list of Users on the database).
I've added the Web Service to the PCL's 'Connected Services'. I followed the following guide: https://www.youtube.com/watch?v=JAmZByNhR8s
On my main page of my Xamarin forms app, I've added the following function and called it inside the constructor:
private async void GetFirstUserIDAsync()
{
TMSDBns.Service1Client client = new TMSDBns.Service1Client
(TMSDBns.Service1Client.EndpointConfiguration.MetadataExchangeHttpBinding_IService11);
var result = await client.GetFirstUserIDAsync();
WSLabel.Text = result;
}
But when I run the app it gives me the following error:
- $exception {System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Error in deserializing body of request message for operation 'GetFirstUserID'. OperationFormatter encountered an invalid Message body.
Expected to find node type 'Element' with name 'GetFirstUserID' and namespace 'http://tempuri.org/'.
Found node type 'Element' with name 'GetFirstUserIDAsync' and namespace 'http://tempuri.org/'
(Fault Detail is equal to Error in deserializing body of request message for operation 'GetFirstUserID'. OperationFormatter encountered an invalid Message body.
Expected to find node type 'Element' with name 'GetFirstUserID' and namespace 'http://tempuri.org/'.
Found node type 'Element' with name 'GetFirstUserIDAsync' and namespace 'http://tempuri.org/').}
System.ServiceModel.FaultException<System.ServiceModel.ExceptionDetail>
Let me know if you need more information.
Thank you.