I have created a basic web service and I need to access it from android but somehow the web service is only accessible on my local machine, with a local URL like http://localhost:4012/MainWebService.asmx but outside my machine when I try something like 187.120.36.4:4012/MainWebService.asmx the 187.120.36.4 being the IP of my machine hosting the asp.net web service it doesn't go through, all my googling efforts have not paid off so far. So any help will be highly appreciated guys and thanks in advance.
-
btw for apache hosted files, I can have access to e.g. i can access a localhost/hostedsite.php on my android via 187.120.36.4/hostedsite.php. They are both connected on same LAN and I am using android as the hotspot, if that will be of any helplulliezy– lulliezy2016-07-17 20:59:13 +00:00Commented Jul 17, 2016 at 20:59
2 Answers
First you need IIS Server. This is how to enable it on W10. Next you need to configure you ASP project to run on the IIS server. Now you should be able to access your webservice on 187.120.36.4:4012/MainWebService.asmx.
BTW. That looks like your external IP. Are you sure it is correct? I would suspect something like 192.168.x.xxx
3 Comments
If your machine is connected to a router then you need enable port forwarding on your router to your local machine and then run your web service in your local machine.
After you have it set up your connect url will be http://<your public ip address>:port number where public ip address is your router's external ip address.