Java: using endpoint to publish webservice to tomcat server

Posted by Will on Stack Overflow See other posts from Stack Overflow or by Will
Published on 2010-01-18T01:54:32Z Indexed on 2010/05/16 2:00 UTC
Read the original article Hit count: 326

Filed under:
|
|
|
|

hi all,

i am creating a simple SOAP web service. i am to ensure that it runs on a tomcat web service.

im trying to implement this with JAX-WS (see code)

my question is: does the Endpoint.publish use the tomcat server to host this or is it a mini glassfish kind of server?

should i be extending UnicastRemoveObject or something similiar instead?

ideally it would be able to be packaged into a .WAR and dropped in the directory and just work.

It doesn't seem to work with my installed tomcat server as is because it says the port is already in use. I'm using Ubuntu karmic with the tomcat6 package installed, it could also be my user doesnt have permissions to publish to the running tomcat on 8080

i hope this question is clear enough

sample code:

@WebService
public class UserAttributes {
    public static void main(String[] args) {
        UserAttributes instance = new UserAttributes();
        Endpoint.publish("http://localhost:8082/WebServices/userattributes", 
            instance);
    }

    public string Hello() {
       return "Hello World";
    }
}

© Stack Overflow or respective owner

Related posts about java

Related posts about webservice