I've already searched around and found this
Connect an Android Device To a Web Service on Local Host
So here is my scenario.
I need to connect to a web service from my android application.
I have a web application running on my laptop. It contains the web service. Its all deployed on apache tomcat 7.0.47. The web service runs fine on localhost. I've also tested it from the android emulator and it calls and displays the output fine.
Now my question is, how do I connect the web service from the android device when its on a different network? I tried giving my public IP in the WSDL URL in the android client (uses ksoap2 libraries) but it doesn't work and gives ECONNREFUSED error in LogCat. I also read that I may have to map the public IP to my internal IP, but I don't know how to do that, and some help will be greatly appreciated.
Android device: Nexus 5 (4.4.2) Server: Apache Tomcat (7.0.47) Machine: MacBook Pro (Mavericks 10.9)
I shall provide code if needed.
Thanks a lot! Vaibhav