title: Spring WS error on define two endpoint with same Namespace and localPart
body: <p>i'm trying to update a project and merge two different module into one. I actually have to define a Spring WS with two @Endpoint which map same @PayloadRoot but they're invoke by different endpoint but i get an error:</p>
  <pre><code>Caused by: org.springframework.context.ApplicationContextException: Cannot map endpoint [..omissis..] on registration key [..omissis..]: there's already endpoint [..omissis..] mapped
  </code></pre>
  <p><strong>EndpointA:</strong></p>
  <pre><code>@Endpoint
  public class EndpointA {
          private static final String NAMESPACE_URI = &quot;http://example.com&quot;;
      
          @PayloadRoot(namespace = NAMESPACE_URI, localPart = &quot;sendSomething&quot;)
          @ResponsePayload
          public Response sendSomething(@RequestPayload Request message) {
          methodA();
          }
  </code></pre>
  <p><strong>EndpointB:</strong></p>
  <pre><code>@Endpoint
  public class EndpointB {
          private static final String NAMESPACE_URI = &quot;http://example.com&quot;;
      
          @PayloadRoot(namespace = NAMESPACE_URI, localPart = &quot;sendSomething&quot;)
          @ResponsePayload
          public Response sendSomething(@RequestPayload Request message) {
          methodB();
          }
  </code></pre>
  <p><strong>WebService</strong>:</p>
  <pre><code>@EnableWs
  @Configuration
  public class WebServiceConfig extends WsConfigurerAdapter {
  
  
      @Bean
      public ServletRegistrationBean&lt;MessageDispatcherServlet&gt; messageDispatcherServlet(ApplicationContext applicationContext) {
          MessageDispatcherServlet servlet = new MessageDispatcherServlet();
          servlet.setApplicationContext(applicationContext);
          servlet.setTransformWsdlLocations(true);
          return new ServletRegistrationBean&lt;&gt;(servlet,&quot;/endpointA/services/*&quot;,&quot;/endpointB/services/*&quot;);
      }
  </code></pre>
  <p>How can i relate with this configuration without changing WSDL definition?</p>
  <p><strong>UPDATE #1:</strong></p>
  <p>After <a href="https://stackoverflow.com/users/2696260/m-deinum">M.Denium</a> help i've tried to register two endpoint separately with two applicationContext like this:</p>
  <pre><code>import ...
  
  //@EnableWs
  @Configuration
  public class WebServiceConfig extends WsConfigurationSupport {
  
     @Override
      public void addInterceptors(List&lt;EndpointInterceptor&gt; interceptors) {
         interceptors.add(new EndpointInterceptor());
      }
  
      @Bean
      public ServletRegistrationBean&lt;MessageDispatcherServlet&gt; messageDispatcherServletA(ApplicationContext applicationContext) {
          AnnotationConfigWebApplicationContext annotationConfigApplicationContext=new AnnotationConfigWebApplicationContext();
  
          annotationConfigApplicationContext.register(EndpointA.class);
          annotationConfigApplicationContext.setParent(applicationContext);
          annotationConfigApplicationContext.refresh();
          
          
          MessageDispatcherServlet servlet = new MessageDispatcherServlet(annotationConfigApplicationContext);
          servlet.setTransformWsdlLocations(true);
  
          return new ServletRegistrationBean&lt;&gt;(servlet,&quot;/clientA/services/*&quot;);
      }
  
      @Bean
      public ServletRegistrationBean&lt;MessageDispatcherServlet&gt; messageDispatcherServletB(ApplicationContext applicationContext) {
          AnnotationConfigWebApplicationContext annotationConfigApplicationContext=new AnnotationConfigWebApplicationContext();
          annotationConfigApplicationContext.register(EndpointB.class);
          annotationConfigApplicationContext.setParent(applicationContext);
          annotationConfigApplicationContext.refresh();
          MessageDispatcherServlet servlet = new MessageDispatcherServlet(annotationConfigApplicationContext);
          servlet.setTransformWsdlLocations(true);
  
          return new ServletRegistrationBean&lt;&gt;(servlet,&quot;/clientB/services/*&quot;);
      }
  </code></pre>
  <p>And excluding this class from component-scan:</p>
  <pre><code>ComponentScan(basePackages = &quot;com.example&quot;,excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,value = EndpointA.class),@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,value = EndpointB.class)})
  public class ExampleApplication {
  
  public static void main(String[] args) {
      SpringApplication.run(ExampleApplication.class, args);
  }
  </code></pre>
  <p>}</p>
  <p>But i'm getting an error:</p>
  <pre><code>|| WARN  | EndpointNotFound.dispatch:237 | No endpoint mapping found for [SaajSoapMessage
  </code></pre>
  <p>I've tried without splitting applicationContext and removing exclude two endpoint and it worked (obviously with only one @Endpoint annotation). Am I making some mistakes?</p>