title: How to publish WebService using Endpoint.publish() method?
body: <p>I am making a basic Hello World Web Service with help of some tutorials online.
  I made a basic Java Project(non dynamic) in Eclipse. On running the code as Java Application and visiting the URL "<a href="http://localhost:9292/ws/hello" rel="nofollow noreferrer">http://localhost:9292/ws/hello</a>" I receive"localhost page isn't working-ERR_EMPTY_RESPONSE" on my browser.Following is the code. Please let me know what am I doing wrong.</p>
  
  <p>SayHello.java</p>
  
  <pre><code>package com.example.hello;
  
  import javax.jws.WebMethod;
  import javax.jws.WebService;
  
  @WebService
  public class SayHello  {
  
  @WebMethod
  public String getHello(String name) {
  
      return "Hello " + name;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>LaunchService.java</p>
  
  <pre><code>package com.example.hello;
  
  import javax.xml.ws.Endpoint;
  
  public class LaunchService {
  
      public static void main(String[] args) {
  
          Endpoint.publish("http://localhost:9292/ws/hello", new SayHello());
  
      }
  
  }
  </code></pre>