title: Java: using endpoint to publish webservice to tomcat server
body: <p>i am creating a simple SOAP web service. 
  i am to ensure that it runs on a tomcat web service.</p>
  
  <p>im trying to implement this with JAX-WS (see code)</p>
  
  <p>my question is:  does the Endpoint.publish use the tomcat server to host this or is it a mini glassfish kind of server?</p>
  
  <p>should i be extending UnicastRemoveObject or something similiar instead?</p>
  
  <p>ideally it would be able to be packaged into a .WAR and dropped in the directory and just work.</p>
  
  <p>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</p>
  
  <p>i hope this question is clear enough</p>
  
  <p>sample code:</p>
  
  <pre><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";
      }
  }
  </code></pre>