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???
Re: Web Service - Client - WORK OVER INTERNET
Quote:
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?
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?
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.
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.
Re: Web Service - Client - WORK OVER INTERNET
You where right. I opened the port 8080 at windows firewall and it worked.!!!
Thanks a lot
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
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.