0

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.

lulliezy
  • 43
  • 1
  • 6
  • btw for apache hosted files, I can have access to e.g. i can access a http://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 help – lulliezy Jul 17 '16 at 20:59

2 Answers2

1

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.

Nic Nilov
  • 5,056
  • 2
  • 22
  • 37
Sai prasant
  • 50
  • 10
1

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

Community
  • 1
  • 1
Robin Dijkhof
  • 18,665
  • 11
  • 65
  • 116
  • my ip is 192.168.xx.xxx but i gave that out as just an example, anyways so how do i configure the asp to run on iis server? – lulliezy Jul 17 '16 at 21:56
  • I believe it was somewhere in the solution properties – Robin Dijkhof Jul 17 '16 at 21:59
  • Thanx man you helped me almost get there, because i still have "HTTP Error 404.17 - Not Found: The requested content appears to be script and will not be served by the static file handler" error – lulliezy Jul 17 '16 at 22:48