Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Web Service - Client - WORK OVER INTERNET

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Web Service - Client - WORK OVER INTERNET

    Hi, i have build a web service and a client for the web service and i want now to put them in different computers.
    I made the web service and client with the eclipse wizard and at both computers i have installed the Apache tomcat 7.
    I have a router to my network.

    I put the web service at the first compter in the tomcat's webapps folder and it works fine at http://localhost:8080/TestService/services/Testclass. The internal IP of the first compter is 192.168.1.3.

    I put the web service client in the second computer at the Tomcat's webapps folder.I change the settings at the client's java classes and i set the web service endpoint to "http://192.168.1.3:8080/TestService/services/Testclass" but when i run the client nothing happens. I guess I must configure tomcat first.

    What should i do???
    Last edited by nikos; October 19th, 2010 at 03:11 AM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Web Service - Client - WORK OVER INTERNET

    but when i run the client nothing happens
    Please define 'nothing happens'...
    Is your host (or client) behind a firewall? Can you access any tomcat services on port 8080 from the client?

  3. #3
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Web Service - Client - WORK OVER INTERNET

    when i run it it throws me an exception: java.net.ConnectException: Connection timed out: connect .

    I don't know if the host or the client are behind a firewall. On one computer runs the windows 7 firewall and nod32 antivirus 4 and on the other computer run windows xp firewall and nod32 antivus 4.

    I've tried to access the tomcat's root page of the first computer fro the second computer from the url "http://192.168.1.3:8080" but the web browser shows me again connection time out error.

    Shouldn't i change settings on tomcat server to be visible on network?

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Web Service - Client - WORK OVER INTERNET

    This is possibly then - at least in part - a firewall issue. You need to allow incoming and outgoing tcp communication on port 8080. I'd suggest googling how to do so. In addition, I know JBoss has some command line parameters to allow it to communicate outside of localhost (by default it does not)...I do not know if your configuration has a similar parameter but its worth investigating.

  5. #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Web Service - Client - WORK OVER INTERNET

    Thank you. I will check those things you told me and i will post a reply with the results.

  6. #6
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Web Service - Client - WORK OVER INTERNET

    You where right. I opened the port 8080 at windows firewall and it worked.!!!
    Thanks a lot

  7. #7
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Web Service - Client - WORK OVER INTERNET

    Now i want to put the web service on my friend's computer that is a diferent home network and the client on my computer .

    my internal IP=192.168.1.3 client
    my externalIP = 75.36.24.54

    my friend's internalIP=192.168.1.2 web service
    my friend's exteralIP=43.65.23.87
    I set the port 8080 to be always opened.

    I tried to call the web service from my house with the url "http://43.65.23.87:8080/TestService/services/Testclass"

    i get the messsage connection time out again.
    Any idea????
    My friend has 2 computers connected on the router with internal IP's 192.168.1.2, 192.168.1.3. How the router will know at which computer to forward the request?

    thanks

  8. #8
    Junior Member
    Join Date
    Oct 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Web Service - Client - WORK OVER INTERNET

    I figured it out. I should change the settings of the router so the port 8080 to be public.

Similar Threads

  1. JAVA help on file: Internet Service Provider
    By Plural in forum What's Wrong With My Code?
    Replies: 26
    Last Post: March 30th, 2014, 11:03 PM
  2. Java web client - > .NET web service
    By codeJ in forum Web Frameworks
    Replies: 0
    Last Post: July 8th, 2010, 04:34 AM
  3. Replies: 2
    Last Post: November 19th, 2009, 11:55 PM
  4. Read XML from Internet Hang
    By yupingliew in forum Java Networking
    Replies: 8
    Last Post: November 9th, 2009, 09:49 AM
  5. Internet Filter to display some website
    By sundarjothi in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: May 15th, 2008, 05:03 AM