title: EndpointNotFound Exception for Spring Boot SOAP Web service
body: <p>I was trying my hand at SOAP web service using spring boot WS. I am creating a maven war project and deploying in tomcat. The wsdl file is getting generated successfully, but when i try from SOAPUI i get the below error :-</p>
  
  <pre><code>o.s.ws.server.EndpointNotFound           : No endpoint mapping found for [SaajSoapMessage {http://spring.io/guides/gs-producing-web-service}sampleRequest]
  </code></pre>
  
  <p>Please find below the details :-</p>
  
  <pre><code> @EnableWs
  @Configuration
  @EnableAutoConfiguration
  public class WebServiceConfig extends WsConfigurerAdapter {
      @Bean
      public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) {
          MessageDispatcherServlet servlet = new MessageDispatcherServlet();
          servlet.setApplicationContext(applicationContext);
          servlet.setTransformWsdlLocations(true);
          return new ServletRegistrationBean(servlet, "/ws/*");
      }
  
      @Bean(name = "countries")
      public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema countriesSchema) {
          DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
          wsdl11Definition.setPortTypeName("CountriesPort");
          wsdl11Definition.setLocationUri("/ws");
          wsdl11Definition.setTargetNamespace("http://spring.io/guides/gs-producing-web-service");
          wsdl11Definition.setSchema(countriesSchema);
          return wsdl11Definition;
      }
  
      @Bean
      public XsdSchema countriesSchema() {
          return new SimpleXsdSchema(new ClassPathResource("countries.xsd"));
      }
  }
  </code></pre>
  
  <p>The Endpoint class :-</p>
  
  <pre><code>@Endpoint
  public class ServiceImpl {
  
      private static final String NAMESPACE_URI = "http://spring.io/guides/gs-producing-web-service";
  
      @PayloadRoot(namespace = NAMESPACE_URI, localPart = "sampleRequest")
      @ResponsePayload
      public JAXBElement&lt;SampleResponse&gt; sampleMethod(
              @RequestPayload JAXBElement&lt;SampleRequest&gt; sampleRequest) {
  
              System.out.println("hi");
              return null;
      }
  }
  </code></pre>
  
  <p>The dependency from pom.xml</p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.1.8.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;      
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jdom&lt;/groupId&gt;
              &lt;artifactId&gt;jdom&lt;/artifactId&gt;
              &lt;version&gt;2.0.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-ws&lt;/artifactId&gt;
              &lt;version&gt;1.2.0.M2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;wsdl4j&lt;/groupId&gt;
              &lt;artifactId&gt;wsdl4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>The Xsd:-</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spring.io/guides/gs-producing-web-service"
             targetNamespace="http://spring.io/guides/gs-producing-web-service" elementFormDefault="qualified"&gt;
  
      &lt;xs:element name="sampleResponse"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element type="xs:string" name="auditReference" /&gt;
                  &lt;xs:element type="xs:string" name="responseCode" /&gt;
                  &lt;xs:element type="xs:string" name="responseMessage" /&gt;
  
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
      &lt;xs:element name="sampleRequest"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element type="xs:string" name="apikey"&gt;
                      &lt;xs:annotation&gt;
                          &lt;xs:documentation&gt;Optional:&lt;/xs:documentation&gt;
                      &lt;/xs:annotation&gt;
                  &lt;/xs:element&gt;
  
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>The complete error log:-</p>
  
  <pre><code>  .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::        (v1.1.8.RELEASE)
  
  2014-10-22 00:36:11.035  INFO 1016 --- [gine[Catalina]]] o.s.boot.SpringApplication               : Starting application on LASST262540 with PID 1016 (D:\O2\workspace\21Oct\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gs-producing-web-service\WEB-INF\lib\spring-boot-1.1.8.RELEASE.jar started by MVenugo1 in D:\sw\eclipse-jee-luna-R-win32\eclipse)
  2014-10-22 00:36:11.082  INFO 1016 --- [gine[Catalina]]] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3a9aaf: startup date [Wed Oct 22 00:36:11 BST 2014]; root of context hierarchy
  2014-10-22 00:36:11.884  INFO 1016 --- [gine[Catalina]]] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'org.springframework.boot.autoconfigure.AutoConfigurationPackages': replacing [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
  2014-10-22 00:36:11.998  INFO 1016 --- [gine[Catalina]]] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
  2014-10-22 00:36:13.146  INFO 1016 --- [gine[Catalina]]] trationDelegate$BeanPostProcessorChecker : Bean 'webServiceConfig' of type [class hello.WebServiceConfig$$EnhancerBySpringCGLIB$$2a27dca8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  2014-10-22 00:36:13.166  INFO 1016 --- [gine[Catalina]]] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [class org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$ae9cf03] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  2014-10-22 00:36:13.254  INFO 1016 --- [gine[Catalina]]] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
  2014-10-22 00:36:13.301  INFO 1016 --- [gine[Catalina]]] .a.c.c.C.[.[.[/gs-producing-web-service] : Initializing Spring embedded WebApplicationContext
  2014-10-22 00:36:13.301  INFO 1016 --- [gine[Catalina]]] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2219 ms
  2014-10-22 00:36:14.759  INFO 1016 --- [gine[Catalina]]] o.s.b.c.e.ServletRegistrationBean        : Mapping servlet: 'messageDispatcherServlet' to [/ws/*]
  2014-10-22 00:36:14.760  INFO 1016 --- [gine[Catalina]]] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'errorPageFilter' to: [/*]
  2014-10-22 00:36:14.761  INFO 1016 --- [gine[Catalina]]] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'metricFilter' to: [/*]
  2014-10-22 00:36:14.761  INFO 1016 --- [gine[Catalina]]] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
  2014-10-22 00:36:14.761  INFO 1016 --- [gine[Catalina]]] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'applicationContextIdFilter' to: [/*]
  2014-10-22 00:36:14.762  INFO 1016 --- [gine[Catalina]]] o.s.b.c.embedded.FilterRegistrationBean  : Mapping filter: 'webRequestLoggingFilter' to: [/*]
  2014-10-22 00:36:15.134  INFO 1016 --- [gine[Catalina]]] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2014-10-22 00:36:15.252  INFO 1016 --- [gine[Catalina]]] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
  2014-10-22 00:36:15.253  INFO 1016 --- [gine[Catalina]]] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
  2014-10-22 00:36:15.275  INFO 1016 --- [gine[Catalina]]] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2014-10-22 00:36:15.276  INFO 1016 --- [gine[Catalina]]] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2014-10-22 00:36:15.808  INFO 1016 --- [gine[Catalina]]] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
  2014-10-22 00:36:15.860  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Registering beans for JMX exposure on startup
  2014-10-22 00:36:15.956  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/dump],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.956  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/beans],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.957  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.957  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics/{name:.*}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
  2014-10-22 00:36:15.958  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/metrics],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.958  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/autoconfig],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.959  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/health],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke()
  2014-10-22 00:36:15.959  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/configprops],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.960  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/mappings],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.960  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/trace],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.961  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env/{name:.*}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
  2014-10-22 00:36:15.961  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "{[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
  2014-10-22 00:36:15.976  INFO 1016 --- [gine[Catalina]]] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
  2014-10-22 00:36:15.979  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
  2014-10-22 00:36:16.007  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
  2014-10-22 00:36:16.013  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'healthEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=healthEndpoint]
  2014-10-22 00:36:16.020  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'beansEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=beansEndpoint]
  2014-10-22 00:36:16.028  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'infoEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=infoEndpoint]
  2014-10-22 00:36:16.033  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'metricsEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=metricsEndpoint]
  2014-10-22 00:36:16.042  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'traceEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=traceEndpoint]
  2014-10-22 00:36:16.046  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'dumpEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=dumpEndpoint]
  2014-10-22 00:36:16.054  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'autoConfigurationAuditEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=autoConfigurationAuditEndpoint]
  2014-10-22 00:36:16.059  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'shutdownEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=shutdownEndpoint]
  2014-10-22 00:36:16.068  INFO 1016 --- [gine[Catalina]]] o.s.b.a.e.jmx.EndpointMBeanExporter      : Located managed bean 'configurationPropertiesReportEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
  2014-10-22 00:36:16.086  INFO 1016 --- [gine[Catalina]]] o.s.boot.SpringApplication               : Started application in 5.583 seconds (JVM running for 276.935)
  2014-10-22 00:36:16.095  INFO 1016 --- [gine[Catalina]]] o.apache.catalina.core.StandardContext   : Reloading Context with name [/gs-producing-web-service] is completed
  2014-10-22 00:36:17.135  INFO 1016 --- [apr-8080-exec-2] .a.c.c.C.[.[.[/gs-producing-web-service] : Initializing Spring FrameworkServlet 'messageDispatcherServlet'
  2014-10-22 00:36:17.144  INFO 1016 --- [apr-8080-exec-2] o.s.w.t.http.MessageDispatcherServlet    : FrameworkServlet 'messageDispatcherServlet': initialization started
  2014-10-22 00:36:17.167  INFO 1016 --- [apr-8080-exec-2] o.s.ws.soap.saaj.SaajSoapMessageFactory  : Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
  2014-10-22 00:36:17.190  INFO 1016 --- [apr-8080-exec-2] o.s.w.t.http.MessageDispatcherServlet    : FrameworkServlet 'messageDispatcherServlet': initialization completed in 45 ms
  2014-10-22 00:36:17.301  WARN 1016 --- [apr-8080-exec-2] o.s.ws.server.EndpointNotFound           : No endpoint mapping found for [SaajSoapMessage {http://spring.io/guides/gs-producing-web-service}sampleRequest]
  </code></pre>