Skip to content
Advertisement

How to replace CXF base url in WSDLs

I’m using Apache CXF and Spring Boot to expose SOAP endpoints. Here’s the config:

JavaScript

You can see that I expose one endpoint. It’s accessible at https://localhost:8081/daas/activate/activateGateway?wsdl:

JavaScript

But this location="https://localhost:8081/daas/activate/activateGateway is not valid because this service is behind api gateway. Is there a way to change the “base url”? For example to this https://localhost:8081/soap/daas/activate/activateGateway (notice the additional /soap prefix).

These files are generated at the start, this is not hardcoded.

Advertisement

Answer

I haven’t found a solution, but rather a workaround. There’s this configuration guide https://cxf.apache.org/docs/jax-ws-configuration.html which mentions publishedEndpointUrl, but sadly it didn’t work for me for some reason. The solution I used is combination of server.servlet.context-path=/test and Ambassador’s rewrite functionality:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement