aspose file tools*
The moose likes Android and the fly likes Web service url not accessible from real device Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Web service url not accessible from real device" Watch "Web service url not accessible from real device" New topic
Author

Web service url not accessible from real device

Astha Sharma
Ranch Hand

Joined: Oct 15, 2011
Posts: 249

Hi,

My Jersey web service url is working fine when I am accessing it from pc's or emulator's browser. But it is not getting accessed from real Android device browser.
This is the url-

http://192.168.0.107:8080/KommaaropmetjeaanbiedingWebServices/jaxrs/services

Please tell me what can be the reason? What I have to do to access it from actual device?


Astha - OCPJP 6 (90%)
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1478
    
    6

Are you sure the device has a valid network connectivity? What exact error/exception are you getting?


Swastik
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Astha Sharma wrote:Hi,

My Jersey web service url is working fine when I am accessing it from pc's or emulator's browser. But it is not getting accessed from real Android device browser.
This is the url-

http://192.168.0.107:8080/KommaaropmetjeaanbiedingWebServices/jaxrs/services

Please tell me what can be the reason? What I have to do to access it from actual device?

That URL would only be accessible from inside your own network: the 192.168.0.107 is an IP address assigned by your local network's router. Your phone would only be able to connect to it if it is on WiFi and on the same network (the phone's IP address should also start with 192.168.0.nnn).

If the phone is on the telco data network, or you want the application accessible from the internet as a whole you will need to:
1) Find out your external IP address
2) Setup your firewall to forward port 8080 to the correct local IP
3) Use the external IP address for the connection.


Steve
Astha Sharma
Ranch Hand

Joined: Oct 15, 2011
Posts: 249

Swastik Dey wrote:Are you sure the device has a valid network connectivity? What exact error/exception are you getting?

Thanks for the reply Swastik. The error it shows is web page is not available when I access it from phone.

Steve Luke wrote:That URL would only be accessible from inside your own network: the 192.168.0.107 is an IP address assigned by your local network's router. Your phone would only be able to connect to it if it is on WiFi and on the same network (the phone's IP address should also start with 192.168.0.nnn). If the phone is on the telco data network, or you want the application accessible from the internet as a whole you will need to:
1) Find out your external IP address
2) Setup your firewall to forward port 8080 to the correct local IP
3) Use the external IP address for the connection.

Thanks for the reply Steve. I will try doing this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web service url not accessible from real device