title: How to replace CXF base url in WSDLs
body: <p>I'm using Apache CXF and Spring Boot to expose SOAP endpoints. Here's the config:</p>
  <pre class="lang-java prettyprint-override"><code>@Slf4j
  @Configuration
  public class SoapWebServiceConfig {
  
      @Bean(name = &quot;cxf&quot;)
      public SpringBus springBus() {
          var loggingFeature = new LoggingFeature();
          loggingFeature.addSensitiveProtocolHeaderNames(Set.of(&quot;Server&quot;, &quot;Accept&quot;, &quot;Date&quot;));
          loggingFeature.setPrettyLogging(true);
  
          var springBus = new SpringBus();
          springBus.getFeatures().add(loggingFeature);
          return springBus;
      }
  
      @Bean
      public ActivateGateway activateGateway() {
          return new ActivateGatewayImpl();
      }
  
      @Bean
      @SneakyThrows
      public Endpoint activateGatewayEndpoint(Bus bus, ActivateGateway activateGateway) {
          EndpointImpl endpoint = new EndpointImpl(bus, activateGateway);
          endpoint.publish(&quot;/activateGateway&quot;);
          return endpoint;
      }
  
      @Primary
      @Bean(name = &quot;cxfServletRegistration&quot;)
      public ServletRegistrationBean&lt;CXFServlet&gt; cxfServletRegistration() {
          ServletRegistrationBean&lt;CXFServlet&gt; servletRegistrationBean = new ServletRegistrationBean&lt;&gt;(
              new CXFServlet(), &quot;/daas/activate/*&quot;);
          servletRegistrationBean.setLoadOnStartup(1);
          return servletRegistrationBean;
      }
  }
  </code></pre>
  <p>You can see that I expose one endpoint. It's accessible at <code>https://localhost:8081/daas/activate/activateGateway?wsdl</code>:</p>
  <pre class="lang-xml prettyprint-override"><code>...
    &lt;wsdl:import location=&quot;https://localhost:8081/daas/activate/activateGateway?wsdl=activateGateway.wsdl&quot; namespace=&quot;http://schemas.symantec.com/cda/1.0/activateGateway&quot;&gt;
      &lt;/wsdl:import&gt;
    &lt;wsdl:binding name=&quot;ActivateGatewayServiceSoapBinding&quot; type=&quot;ns1:activateGateway&quot;&gt;
    ...
    &lt;wsdl:service name=&quot;ActivateGatewayService&quot;&gt;
      &lt;wsdl:port binding=&quot;tns:ActivateGatewayServiceSoapBinding&quot; name=&quot;activateGatewayPort&quot;&gt;
        &lt;soap:address location=&quot;https://localhost:8081/daas/activate/activateGateway&quot;/&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  </code></pre>
  <p>But this <code>location=&quot;https://localhost:8081/daas/activate/activateGateway</code> is not valid because this service is behind api gateway. Is there a way to change the &quot;base url&quot;?
  For example to this <code>https://localhost:8081/soap/daas/activate/activateGateway</code> (notice the additional <code>/soap</code> prefix).</p>
  <p>These files are generated at the start, this is not hardcoded.</p>