title: How to use CXF soap servlet aside spring REST servlet?
body: <p>I'm providing a <code>soap</code> webservice with java-first approach, thus using <code>CXF</code> for this. To make it publishing with <code>spring-boot</code>, I have the following dispatcher servlet:</p>
  
  <pre><code>@Bean
  public ServletRegistrationBean dispatcherServletRegistration() {
      ServletRegistrationBean registration = new ServletRegistrationBean(new CXFServlet(), "/services/*");
      registration.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
      return registration;
  }
  </code></pre>
  
  <p>This works fine, but I now want to offer a <code>REST</code> service aside. The rest service should NOT be published by cxf, but by the default spring mapping:</p>
  
  <pre><code>@RestConstroller
  @RequestMapping("/rest/content")
  public class MyServiceRest extends SpringBeanAutowiringSupport {
  
  }
  </code></pre>
  
  <p>The result of this:</p>
  
  <ul>
  <li><code>localhost:8080/app-name/rest/content</code> results in HTTP 404.</li>
  <li><code>localhost:8080/app-name/services/rest/content</code> shows a spring message <code>"No service was found."</code></li>
  </ul>
  
  <p>So, somehow the latter is inside the context of the <code>CXFServlet</code>, and the REST service is not found.</p>
  
  <p>What do I have to change to make this setup work?</p>
  
  <p>By the way: when I remove the <code>ServletRegistrationBean</code>, the rest service works as expected. But that's not an option as I have to offer the soap service alongside.</p>