title: JAX-WS multiple endpoints Not Found: Invalid Request
body: <p>I'm trying implement a web service for two endpoints and getting this error
  "<strong>404 Not Found: Invalid Request</strong>" when tried accessing the service after deploying onto the apache toncat 8.</p>
  
  <p>Below are my web service implementation classes, sun-jaxws.xml and web.xml</p>
  
  <p>WebImplementation1.java</p>
  
  <pre><code>package com.ws.soap.services;
  import javax.jws.WebService;
  
  @WebService(endpointInterface = "com.ws.soap.services.WebServiceImpl1")
  public class WebServiceImpl1  {
  
      public String printMessage() {
          return "Hello from WebServiceImpl1 ";
      }
  }
  </code></pre>
  
  <p>WebServiceImplementation2.java</p>
  
  <pre><code>package com.ws.soap.services;
  
  import javax.jws.WebService;
  
  @WebService(endpointInterface = "com.ws.soap.services.WebServiceImpl2")
  public class WebServiceImpl2 {
  
      public String displayMessage() {
          return "Hello from WebServiceImpl2 ";
      }
  }
  </code></pre>
  
  <p>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="WebServiceImpl1" implementation="com.ws.soap.services.WebServiceImpl1"
          url-pattern="/impl1" /&gt;
      &lt;endpoint name="WebServiceImpl2" implementation="com.ws.soap.services.WebServiceImpl2"
          url-pattern="/impl2" /&gt;
  &lt;/endpoints&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
      &lt;display-name&gt;JAX-WS-Tomcat&lt;/display-name&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;sayhello&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;sayhello&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/impl1&lt;/url-pattern&gt;
          &lt;url-pattern&gt;/impl2&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;session-config&gt;
          &lt;session-timeout&gt;30&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>