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 access WCF service hosted in IIS Express from an Android mobile in the same subnet

BachuBachu INMember

Dear All,

I am following the Xamarin guide for creating a WCF service and consuming from an android device in the same subnet.
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/
Both the devices are connecting to same home Wifi network.

Device 1:
Laptop: Development machine (WCF Service hosted here)
OS: Windows 10, Visual Studio 2015 Community Edition
Ip Address: 192.168.2.6
Web Server: IIS Express

Device 2:
Mobile: WCF Client
OS: Android 6.0 with debugger mode enabled
Ip Address: 192.168.2.5

I could run the HelloWorld sample from my developer machine and I could connect to the service running at http://192.168.2.6:9898/HelloWorldService.svc
from the Android Emulator client. Please see the IIS express screenshot attached for the WCF service sites listed.

Then I deployed the client to my Android mobile and then tried to trigger the WCF operations it failed.
It threw an EndPointNotFoundException (attached)
System error -> System.Net.WebException:Error: Connection failure (No route to host)

I followed section "Configuring Remote Access to IIS Express" step "IIS Express to Accept Remote connections".
Also I added port 9898 as a exception to Firewall(even disabled the Windows Firewall).

I tried accessing http://192.168.2.6:9898/HelloWorldService.svc from mobile but I couldn't.
Even ping doesn't work from mobile to developer machine using (Ping App).

Environment I am in:
Both the devices are connected to same WIFI connection through a Wireless router(Belkin 300N).
I could see both the devices are in same subnet with the IP addresses. Even I tried with another laptop in same Wifi network, I couldn't access the WCF service exposed in developer machine.

Anybody faced a similar issue accessing WCF service hosted in Windows 10 IIS Express.
Please point me if I am missing something which blocks access to WCF service hosted in the developer machine.

Thanks
Bachu

Answers

  • PamPam PHMember

    Have you managed to solve it? Because this is my current problem.

Sign In or Register to comment.