title: How to create standalone WSDL based web service using Spring WS?
body: <p>Please, help me to run standalone web service on local machine using Spring WS and existing wsdl. 
  I am new in Spring WS. There is my code:
  package com.mayacomp.ws;</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.context.annotation.ComponentScan;
  
  @ComponentScan
  @EnableAutoConfiguration
  public class Application {
      public static void main(String[] args) throws Exception {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>web service end point:</p>
  
  <pre><code>package com.mayacomp.endpoint;
  import org.springframework.ws.server.endpoint.annotation.Endpoint;
  import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
  import org.springframework.ws.server.endpoint.annotation.RequestPayload;
  import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
  
  import com.mayacomp.pack.intRequest;
  import com.mayacomp.pack.IntResponse;
  
  
  @Endpoint
  public class WsEndpoint {
  
      private static final String NAMESPACE_URI = "http://new.webservice.namespace";
  
      @PayloadRoot(namespace = NAMESPACE_URI, localPart = "intRequest")
      @ResponsePayload
      public IntResponse getIntHist(@RequestPayload intRequest request) {
          try {
  com.mayacomp.pack.IntResponse _return = new com.mayacomp.pack.IntResponse();
          /*a lot of setters for _return object*/
              return _return;
          } catch (java.lang.Exception ex) {
              ex.printStackTrace();
              throw new RuntimeException(ex);
          }
      }
  
  }
  </code></pre>
  
  <p>and webservie config:</p>
  
  <pre><code>package com.mayacomp.ws;
  
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.context.embedded.ServletRegistrationBean;
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.core.io.ClassPathResource;
  import org.springframework.ws.config.annotation.EnableWs;
  import org.springframework.ws.config.annotation.WsConfigurerAdapter;
  import org.springframework.ws.transport.http.MessageDispatcherServlet;
  import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
  import org.springframework.ws.wsdl.wsdl11.Wsdl11Definition;
  
  @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 = "MayaService")
        public Wsdl11Definition defaultWsdl11Definition() {
          SimpleWsdl11Definition wsdl11Definition = new SimpleWsdl11Definition();
          wsdl11Definition.setWsdl(new ClassPathResource("MayaService.wsdl"));
          return wsdl11Definition;
        }
  }
  </code></pre>
  
  <p>my pom file looks like:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  
      &lt;artifactId&gt;maya-ws&lt;/artifactId&gt;
  
      &lt;dependencies&gt;
          &lt;!-- tag::springws[] --&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.3.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;!-- end::springws[] --&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;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>I need to run application (I can run) and get web service via link like localhost:8080/ws/MayaService?wsdl 
  I will be glad for any advices. </p>