title: JAX-WS multiple endpoints in sun-jaxws.xml
body: <p>Just started using JAX-WS. I created 2 test web services in the one WAR file as follows....</p>
  
  <pre><code>package com.djs;
  
  import javax.jws.WebService;
  
  @WebService()
  public class AddTwoInts {
  
      public int performAdd(int firstNum, int secondNum) {
          return firstNum + secondNum;
      }
  }
  </code></pre>
  
  <p>And.....</p>
  
  <pre><code>package com.djs;
  
  import javax.jws.WebService;
  
  @WebService()
  public class SayHello {
  
      public String sayHello(String inwards) {
          return "Hello " + inwards;
      }
  }
  </code></pre>
  
  <p>This is my web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
                               http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;
              com.sun.xml.ws.transport.http.servlet.WSServletContextListener
          &lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;jaxws&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;jaxws&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>This is the sun-jaxws.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'&gt;  
      &lt;endpoint name='performAdd' implementation='com.djs.AddTwoInts' url-pattern='/AddTwoInts' /&gt;
      &lt;endpoint name='sayHello' implementation='com.djs.SayHello' url-pattern='/SayHello' /&gt;
  &lt;/endpoints&gt; 
  </code></pre>
  
  <p><br>
  I deploy into Tomcat 7 and use <code>http://localhost:8080/MyApp/AddTwoInts?wsdl</code> to get the WSDL for AddTwoInts OK.... But when I execute <code>http://localhost:8080/MyApp/SayHello?wsdl</code> I get a 404 page not found error....</p>
  
  <p>Any advice appreciated.</p>