title: JAX-WS Endpoint not working
body: <p>I'm writing a (very) small SOAP web service using Glassfish.  The code I have is below:</p>
  
  <p><strong>Milliseconds.java</strong></p>
  
  <pre><code>package com.suture.self.ws;
  
  import javax.jws.WebMethod;
  import javax.jws.WebService;
  import javax.jws.soap.SOAPBinding;
  import javax.jws.soap.SOAPBinding.Style;
  import javax.jws.soap.SOAPBinding.Use;
  
  @WebService
  @SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
  public interface Milliseconds {
      @WebMethod
      String currentMilliseconds();
  }
  </code></pre>
  
  <p><strong>MillisecondsImpl.java</strong></p>
  
  <pre><code>package com.suture.self.ws;
  
  import javax.jws.WebService;
  
  @WebService(endpointInterface = "com.suture.self.ws.Milliseconds") 
  public class MillisecondsImpl implements Milliseconds {
  
      @Override
      public String currentMilliseconds() {
          return String.valueOf(System.currentTimeMillis());
      }
  }
  </code></pre>
  
  <p><strong>MillisecondsEndpoint.java</strong></p>
  
  <pre><code>package com.suture.self.ws;
  
  import javax.xml.ws.Endpoint;
  
  public class MillisecondsEndpoint {
  
      public static void main(String[] args) {
          Endpoint.publish("http://sutureself.com:9292/ws/milli", new MillisecondsImpl());
      }
  }
  </code></pre>
  
  <p>When I run this on my Glassfish server (through Eclipse), the admin console shows me the usual working <code>?wsdl</code> and <code>?Tester</code> endpoints, but not the one I have created. Hitting that url (<a href="http://sutureself.com:9292/ws/milli" rel="nofollow">http://sutureself.com:9292/ws/milli</a>) in a browser also returns an "Unable to connect" error.</p>
  
  <p>If I select "Launch", then I am shown two links (one for each http port in Glassfish), but these return a 404.</p>
  
  <p>If I just try to hit the "Context Root" path, that also doesn't work.  I need a point of entry and I just cannot find it.</p>
  
  <p>What am I missing?</p>
  
  <p>Please note! All the <code>sutureself.com</code>'s in the above code are actually <code>localhost</code>, SO doesn't like you posting URL's with localhost evidently.</p>
  
  <p>Any more information as to how my setup is configured will happily be added.</p>