×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    19

    Unhappy I got a WS! what now? =(

    Hi!

    I made a Web Service in Netbeans using GlassFish. I also made a Mobile App that consumes the web service and it works fine.

    But how do I see it in action? I want to have this app in my mobile phone and see how it really consumes the web service.

    What do I got to do? I saw the Client's URL is "localhost", but I think that shouldnt be there. I got a router, and I would like the service running in my PC and see it in my mobile phone

    how do I do this?

    thanx =)

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: I got a WS! what now? =(

    To access a web service (or any web content) from your mobile phone, you need the machine where this content is located to have a Public IP (and this to be publicly accessible).

    Depending on the provider you use for your network connectivity, you could have one.

    A simple way to check this out is this:

    * retrieve your public IP (i.e. going to www.whatismyip.org)
    * start your webservice
    * try to access your web service via your public IP

    Note that, if you're behind a router, you should first configure its NAT settings to let your local IP be visible from outside on a particular port.

    Another, simpler, way would be to check for (free?) hostings that allow you to publish your content on their space.

    Hope this helps!
    Pit

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    19

    Question Re: I got a WS! what now? =(

    Quote Originally Posted by jappit View Post
    To access a web service (or any web content) from your mobile phone, you need the machine where this content is located to have a Public IP (and this to be publicly accessible).

    Depending on the provider you use for your network connectivity, you could have one.

    A simple way to check this out is this:

    * retrieve your public IP (i.e. going to www.whatismyip.org)
    * start your webservice
    * try to access your web service via your public IP

    Note that, if you're behind a router, you should first configure its NAT settings to let your local IP be visible from outside on a particular port.

    Another, simpler, way would be to check for (free?) hostings that allow you to publish your content on their space.

    Hope this helps!
    Pit
    Well I looked for and found my IP. But as far as I know that IP is actually my router's IP, so I port forwarded to port 8080 where glassfish is running making a Virtual Server in my router.

    I changed "http://localhost/..." to my "http://<myIP>/..." in my Client config

    Everything worked fine in the Emulator. I could even use the service and it ACKed very well. I know that the emulator used the Internet because when I disabled the Virtual Server it didn't work, and when I enabled the Virtual Server in the router again it worked.

    However, I put the .jar file in a real mobile phone, and it didn't work =S. Why could this be?? It worked right in the emulator (and Im sure the emulator used the internet), but not in the mobile

    You mentioned something about the Public IP. I tried a website that checks if my IP is public and it told me it is public. I checked other sites and they told me the same


    what do you think could be going on? what should I do in order to make it work?

    Thanx BTW for ur help =)

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: I got a WS! what now? =(

    Just a question, to remove any doubts: can you access your WebService from another PC, external to your local network (or, similarly, from Web browser of your phone)?

    Pit

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    19

    Exclamation Re: I got a WS! what now? =(

    Quote Originally Posted by jappit View Post
    Just a question, to remove any doubts: can you access your WebService from another PC, external to your local network (or, similarly, from Web browser of your phone)?

    Pit
    I tried it today. It actually didn't work. But I still got my doubts because I left my PC turned on, I dont know if for some reason it was turned off, because when I got home it had restarted.

    If I'm actually wrong and this doesn't work, what could be the problem then?

    thanx

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: I got a WS! what now? =(

    If you cannot access your WS from another PC, is rather hard that you will succeed from a mobile phone. This because, if you have correctly configured NAT on your router, most probably your IP is not publicly accessible.

    At this point, a possible solution would be or to buy a static IP from your Internet Service Provider (quite expensive most of times), or to use some hosting providers that support the languages/technologies you used.

    Pit

    Pit

  7. #7
    Registered User
    Join Date
    Feb 2008
    Posts
    19

    Smile Re: I got a WS! what now? =(

    Quote Originally Posted by jappit View Post
    If you cannot access your WS from another PC, is rather hard that you will succeed from a mobile phone. This because, if you have correctly configured NAT on your router, most probably your IP is not publicly accessible.

    At this point, a possible solution would be or to buy a static IP from your Internet Service Provider (quite expensive most of times), or to use some hosting providers that support the languages/technologies you used.

    Pit

    Pit
    In that case, can you recommend me any hosting provider?

    Thanx for your help!

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    19

    Talking Re: I got a WS! what now? =(

    Im sorry for this Double Post hehe

    I tried making a WS using the GlobalWeather WSDL found in webservicex.com and it did work in the mobile

    so its absolutely my IP. it Seems that I can't host this service in my own PC. But again my question: do you know any site that could host my service?

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×