【发布时间】:2020-09-16 18:32:19
【问题描述】:
我正在开发代码查看https://howtodoinjava.com/spring-boot/spring-boot-soap-webservice-example/,在下面的bean中我想允许为/*和/service/*执行请求,所以我改为
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext){
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/service/*");
}
到
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext){
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/*","/service/*");
}
当我们执行/service/* url 时,以下配置不起作用。我们如何解决这个问题?
【问题讨论】:
-
您是否尝试过将更具体的 url 映射放在首位?我不会有太多帮助,因为我已经很长时间没有使用 SOAP 做了很多事情了。
-
是的,我已经尝试过先更具体,然后再更通用,但没有奏效。你能帮我解决这个问题吗?
-
你能不能把
/*改成/**,还要确保wsdl11Definition.setLocationUri根据端点正确使用,然后再试一次
标签: spring spring-boot soap spring-ws