title: Spring Boot Soap :How to initiate @WebService into Spring Boot Application?
body: <p>I am migrating a web service into spring boot.
  From wsdl i am able to generate following interface</p>
  <pre><code>@WebService(targetNamespace = &quot;http://tsb.hcl.com/terp/ws/v2&quot;, name = &quot;Terp-v2&quot;)
  @XmlSeeAlso({com.hcl.psi.tsb.schema.common.ObjectFactory.class, com.hcl.psi.tsb.schema.offering.ObjectFactory.class, com.hcl.psi.kil.system.message.ObjectFactory.class, com.hcl.tsb.terp.ws.schema.ObjectFactory.class, com.hcl.psi.tsb.schema.task.ObjectFactory.class, com.hcl.psi.tsb.schema.servicecontract.ObjectFactory.class, com.hcl.psi.tsb.schema.project.ObjectFactory.class, com.hcl.tsb.tsb.ObjectFactory.class, com.hcl.psi.tsb.schema.customer.ObjectFactory.class})
  @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  public interface TerpV2 {
  
      @WebMethod(operationName = &quot;GetServiceContracts&quot;)
      @WebResult(name = &quot;GetServiceContractsResponseType&quot;, targetNamespace = &quot;http://tsb.hcl.com/terp/ws/schema&quot;, partName = &quot;payload&quot;)
      public com.hcl.tsb.terp.ws.schema.GetServiceContractsResponseType getServiceContracts(
          @WebParam(partName = &quot;payload&quot;, name = &quot;GetServiceContractsType&quot;, targetNamespace = &quot;http://tsb.hcl.com/terp/ws/schema&quot;)
          com.hcl.tsb.terp.ws.schema.GetServiceContractsType payload
      ) throws TerpServiceFault;
  </code></pre>
  <p>I am not sure how to initiate it in Spring Boot application form baeldung website. I tried implementing following code:</p>
  <pre><code>@EnableWs
  @Configuration
  public class WebServiceConfig extends WsConfigurerAdapter {
  
      @Bean
      public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
          MessageDispatcherServlet servlet = new MessageDispatcherServlet();
          servlet.setApplicationContext(applicationContext);
          servlet.setTransformWsdlLocations(true);
          return new ServletRegistrationBean(servlet, &quot;/ws/*&quot;);
      }
  
  
      @Bean(name = &quot;TerpService&quot;)
      public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema countriesSchema) {
          DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
          wsdl11Definition.setPortTypeName(&quot;Terp-v2&quot;);
          wsdl11Definition.setLocationUri(&quot;/tsb/tone/ws/v2/TerpService/&quot;);
          wsdl11Definition.setTargetNamespace(&quot;http://www.baeldung.com/springsoap/gen&quot;);
          wsdl11Definition.setSchema(countriesSchema);
          return wsdl11Definition;
      }
  
      @Bean
      public XsdSchema countriesSchema() {
          return new SimpleXsdSchema(new ClassPathResource(&quot;countries.xsd&quot;));
      }
  }
  </code></pre>
  <p>But I am not sure how to initiate above interface or it's implementation into spring boot context?</p>
  <p>Do i need to write whole contract classes manually?</p>
  <p>Can anyone guide me about same. Thanks</p>