title: Creating a Simple JAX-WS WebService in Eclipse
body: <p>I'm trying to create a simple web service in eclipse. First i created an empty java project and added the three following files in the src folder</p>
  
  <ol>
  <li>Greeting.java</li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>package com.alfaisaliah;
  
  import javax.jws.WebService;
  import javax.jws.WebMethod;
  
  @WebService
  public interface Greeting {
      @WebMethod
      String sayHello(String name);
  }
  </code></pre>
  
  <ol start="2">
  <li>GreetingImp.java</li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>package com.alfaisaliah;
  
  import javax.jws.WebService;
  
  @WebService(endpointInterface="com.alfaisaliah.Greeting")
  public class GreetingImp implements Greeting {
  
      @Override
      public String sayHello(String name) {
          return "Hello " + name;
      }
  }
  </code></pre>
  
  <ol start="3">
  <li>WSPublisher</li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>package com.alfaisaliah;
  
  import javax.xml.ws.Endpoint;
  
  public class WSPublisher {
      public static void main(String[] args){
          Endpoint.publish("http://localhost:8081/WS/Greeting", new GreetingImp());
      }
  }
  </code></pre>
  
  <p>The tutorial I'm following doesn't specify any server to run the web service on! I'm wondering if I need to specify any server. I already have Tomcat v5.5 but am not using it in this example. Whenever I run this project as a java project I get some kind of error. Can anyone please help me identify where my problem is trying to run the web service. Here is the output of the eclipse console </p>
  
  <pre><code>Feb 26, 2012 12:01:00 PM com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrapperClass
  INFO: Dynamically creating request wrapper Class com.alfaisaliah.jaxws.SayHello
  
  Feb 26, 2012 12:01:00 PM com.sun.xml.internal.ws.model.RuntimeModeler getResponseWrapperClass
  INFO: Dynamically creating response wrapper bean Class com.alfaisaliah.jaxws.SayHelloResponse
  </code></pre>
  
  <p>Also when I run the project again it says that the address is already in use</p>
  
  <pre><code>Feb 26, 2012 12:01:00 PM com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrapperClass
  INFO: Dynamically creating request wrapper Class com.alfaisaliah.jaxws.SayHello
  
  Feb 26, 2012 12:01:00 PM com.sun.xml.internal.ws.model.RuntimeModeler getResponseWrapperClass
  INFO: Dynamically creating response wrapper bean Class com.alfaisaliah.jaxws.SayHelloResponse
  Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Address already in use
  </code></pre>
  
  <p>I would appreciate your help guys :)</p>