I'm trying to make a Spring Boot Soap WebService application, and was following the Get Started (https://spring.io/guides/gs/producing-web-service/) example to learn how to do this.
I've created what I want, but I have two URL problems with this setup and I could not find what configuration should I change to fix this :
I know that this is a feature for Spring WS, but I want a fixed URL (without 'whatever' in both cases) and could not find what to change for this
There is no straight forward way to restrict the way you want.
The thing you wanted is possible following way.
ServletRegistrationBean
to restrict URL access/ws/*
mapping is the reason why all the /ws/whatever
url successfully responded.new ServletRegistrationBean(servlet, "/ws");
/ws
URLDefaultWsdl11Definition
is actually generating WSDL from XSD on every request.countries.wsdl
to resource
folder as static WSDL file. DefaultWsdl11Definition
bean.Create a new SimpleWsdl11Definition
bean as like
@Bean(name = "countries")
public SimpleWsdl11Definition orders() {
SimpleWsdl11Definition wsdl11Definition = new SimpleWsdl11Definition();
wsdl11Definition.setWsdl(new ClassPathResource("countries.wsdl"));
return wsdl11Definition;
}
Now add another static URL mapping in ServletRegistrationBean
. As it will be finally look like new ServletRegistrationBean(servlet, "/ws", "/ws/countries.wsdl");
static-wsdl
for production environment. Details ** here