Deploying Java SE6 stand alone web service on a server

102 Views Asked by At

Follwing the steps as outlined here: Standalone web service

I created a test web service that works great on my local machine. Since this is 'stand alone' I copied the same root folder on to a 'server' that I use and published the service on the server (as if it is my local machine). When I access the wsdl using localhost as the domain name, it works fine on the server. However, when I try the url from a different macihne on the network giving the server's domain name instead of localhost, I get a 'can not be displayed' error in IE.

My question is, should this even be possible? Or is there anything specific that needs to be done. Since this is a 'stand alone' solution, we should not require 'another' container like tomcat correct?

1

There are 1 best solutions below

0
On BEST ANSWER

To be honest, until your post, I had no idea there was a builtin, lightweight, HTTP Server in the JDK. I've always used glassfish for my web service needs.

I can't say for sure, but if you look closely at the example code you'll see:

Endpoint endpoint = Endpoint.publish("http://localhost:8080/calculator", calculator);

I suspect that this limits you to "localhost" as opposed to the host machine. Try changing it so that it represents the name of the server and try again from another machine (naturally making sure it can get through the firewall as well). Something like:

Endpoint endpoint = Endpoint.publish("http://myserver:8080/calculator", calculator);

Rebuild it and try again. Other than that, you'd need to create a proper war file and deploy to glassfish, tomcat, etc.