title: Connect to a web service on local machine from android device on different network
body: <p>I've already searched around and found this</p>
  
  <p><a href="https://stackoverflow.com/questions/6176609/connect-an-android-device-to-a-web-service-on-local-host">Connect an Android Device To a Web Service on Local Host</a></p>
  
  <p>So here is my scenario.</p>
  
  <p>I need to connect to a web service from my android application.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>Android device: Nexus 5 (4.4.2)
  Server: Apache Tomcat (7.0.47)
  Machine: MacBook Pro (Mavericks 10.9)</p>
  
  <p>I shall provide code if needed.</p>
  
  <p>Thanks a lot!
  Vaibhav</p>