File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Web Service over LAN Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Service over LAN" Watch "Web Service over LAN" New topic
Author

Web Service over LAN

Manoj Krishnan
Greenhorn

Joined: Jan 21, 2011
Posts: 9
Hi,

I have developed a web service using Eclipse Java EE+apache geronimo server. I am able to deploy the web service locally on my Windows 7 laptop and I can access the service perfectly on localhost. However, I want to make the service available to another system ( a PC ) on my network. I am able to ping my laptop from my PC. But, when I try entering the URL at which the service is running, I am not able to access it.

In my laptop, I enter this URL to access the service: http://localhost:8080/jaxws-compressor-1.0/index.jsp
from my PC I enter this : http://192.168.1.5:8080/jaxws-compressor-1.0/index.jsp

but I am not able to access it. My IP address is correct. There seems to be some other problem here. How do I make a web service available over a WLAN ? Any and all help is appreciated!

I am a newbie to web service development and it would be awesome if anyone out here could help me out with this.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
My guess is that there is a firewall stopping the requests to the web service.
Try to disable the entire firewall and send a request. If that succeeds, then enable the firewall again and configure it to let requests to the service pass through.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Elchin Asgarli
Ranch Hand

Joined: Mar 08, 2010
Posts: 222

You could also use ping and traceroute (tracert in windows) to check the connectivity


Personal page, SCJP 6 with 91%, SCWCD 5 with 84%, OCMJD
Shashank Ag
Ranch Hand

Joined: Dec 22, 2009
Posts: 88

Which antivirus are you using on both machines?
Disable the antiviruses for a moment on both and retry.

Also in windows 7, windows defender is pre-installed. Disable that too.


SCJP 91%, SCWCD 97%
Manoj Krishnan
Greenhorn

Joined: Jan 21, 2011
Posts: 9
Thanks for the replies!
My server machine is a Win7 machine. I tried doing port forwarding on my router to automatically route all port 80 requests to my server machine. But that did not work.
I also disabled the firewall on my server and tried. Still did not work. I shall try disabling all the antivirus software on my server.

WHat I want to know is this. If I have a geronimo server running on localhost on my server, is it practically possible to access this web service ( which is running on localhost ) from another system on the network, without making any other changes?

My core web service involves some java code. I exported this core package to a jar file and created a wsdl file from this jar file using wsgen. I then placed the generated wsdl and xsd files in the project's web-inf folder. After that, I created a jsp file in which I accessed the service. Now, this jsp file is running on localhost as the frontend of my service. Now, having this jsp file running on localhost accessing the web service locally, is it possible for me to call this jsp file from another machine on the network and invoke the service? Is this possible?

I am a total newbie to this and I have absolutely no idea what I am doing wrong. Please help me out.
Thanks in advance!
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Manoj,

What problem are you getting? Can you post detailed stack trace? From your laptop, can you run the link using IP address rather localhost? Sometimes you have to enable the server to serivce the requests accessing through IP address.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
kevan miller
Greenhorn

Joined: Jan 24, 2011
Posts: 1
Your best way of looking for help with this would be to ask on the Geronimo user mailing list (user@geronimo.apache.org).

What IP address is your server listening on? If it's listening on 'localhost', you wouldn't be able to connect from an external ip address. You can test basic web connectivity by directing your web browser to http://<your-ip-address>:8080 -- can you load the default page? If so, then test the wsdl that's being generated for your service.

--kevan
Manoj Krishnan
Greenhorn

Joined: Jan 21, 2011
Posts: 9
I tried quite a few things, but in vain. I finally created an ad-hoc network and made the other system connect to my ad-hoc network. I then switched off my anti-virus and my firewall. Then, it worked. My problem is I need to implement this on my university's local intranet. Any system on the network should be able to access the web service. Any idea how I can go about doing that?
@Kevan: When i direct my browser to my local IP address, it's working fine. But when I do the same from another system, it doesn't work out.

I need the service to work for all users connected to a particular network. As of now, it works on my local ad-hoc network. Could you tell me how I can extend it to work on a local network ?

Thanks to all of you for your time and help. .
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Manoj Krishnan wrote:My problem is I need to implement this on my university's local intranet. Any system on the network should be able to access the web service. Any idea how I can go about doing that?

You probably do not want to do that without the knowledge of the network/system administrators, so asking them how to set up the network is a good idea.
Best wishes!
 
 
subject: Web Service over LAN
 
Similar Threads
Servlets are not accessible but jsps are accessible.
JSP
need help tracing soap messages
Error accessing application in Tomcat 5
Tomcat intranet Web Application