Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Unable to connect to a Web Service in Xamarin.Android(C#)

AnonymousUserAnonymousUser USMember ✭✭✭
edited November 2017 in Xamarin.Android

I've added the webreference in the Xamarin.Android App, then I instantiate it in the code like that:

WebReference.WebServiceEmp service = new WebReference.WebServiceEmp();
var data = service.HelloWorld();
But it throws:

System.Net.WebException: Error: ConnectFailure (Connection timed out)
When I add the service reference in Console Application instantiateing it like that:

service= new ServiceReference1.WebServiceEmpSoapClient();
DataTable data = service.Add();
It works fine. Why it doesn't work in Xamarin Android app? (I added the reference url like that: http://(myIp):8092/WebServiceEmp.asmx)

Best Answer


Sign In or Register to comment.