0

I am new to webservices and I am creating an android application that will send and recieve data from a webservice. I have created a REST webservice in Eclipse using Java. I have used Tomcat server. I am running the webservice on my localhost (Dell laptop with Windows 10 OS).

When i am running the webservice and providing data on my localhost, the service is Returning JSON data successfully but when I am trying to access the same service from my smartphone's chrome browser, its showing ERR_CONNECTION_TIMED_OUT.

Note: Both devices are connect to same network. (I am using MTS blaze)

Things I have tried till now,

  1. Enabled ICMP in firewall settings
  2. Turned off firewall
  3. Uninstalled Mcafee

But no success. Let me know if more information is required to solve this issue.

Edit1: Url on localhost: localhost:8080/Credentials/register/doregister?user=abc&pass=efg

Url when accessing from smartphone: 192.168.1.100/Credentials/register/doregister?user=abc&pass=efg

AnshX
  • 71
  • 1
  • 1
  • 7
  • Please show the used url. – greenapps Jan 29 '16 at 13:38
  • @greenapps i have edited. Kindly check. – AnshX Jan 29 '16 at 13:51
  • You have to add :8080 too in the url you use on the phone. – greenapps Jan 29 '16 at 13:54
  • @greenapps kindly look carefully. I have provided it. But anyways I have highlighted it. – AnshX Jan 29 '16 at 13:54
  • Okay. Let me try and revert back if it works. – AnshX Jan 29 '16 at 13:56
  • @greenapps so i tried 192.168.1.100:8080/Credentials/register/doregister?user=abc&pass=efg. Still its displaying ERR_CONNECTION_TIMED_OUT – AnshX Jan 29 '16 at 14:03
  • Did you try again without firewall? 192.168.1.100 is the ip address of your server? Not of the phone? Or from your router? Use ipconfig/ifconfig to find out. – greenapps Jan 29 '16 at 14:04
  • Did you bind your Tomcat server only to 127.0.0.1? Have a look in it's settings. – greenapps Jan 29 '16 at 14:06
  • Okay. So it is the ipv4 address under "Wireless lan adapter wifi". Secondly, when i turned off the firewall and windows defender, it is giving "ERR_CONNECTION_REFUSED. Third, I checked the server configuration, it is binded to 127.0.0.1 under connector tag. – AnshX Jan 29 '16 at 14:21
  • You did not tell if that ipv4 address is of your computer or your phone. Moreover you dont seem to realize that if Tomcat is ONLY bound to 127.0.0.1 that you have a problem. Your probkem! – greenapps Jan 29 '16 at 15:49
  • @greenapps Thanks for the support. I reinstalled my server and its working great now. – AnshX Jan 30 '16 at 05:45

0 Answers0