【发布时间】:2018-03-29 12:50:02
【问题描述】:
我已经能够获得一个带有 wsdl 文件的 @Endpoint:
@EnableWs
@Configuration
public class EventServerConfiguration extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/event");
}
@Bean(name = "wsdl-event")
public Wsdl11Definition defaultWsdl11Definition() {
SimpleWsdl11Definition wsdl11Definition = new SimpleWsdl11Definition();
wsdl11Definition.setWsdl(new ClassPathResource("/wsdl/event.wsdl"));
return wsdl11Definition;
}
@Bean
AnnotationActionEndpointMapping endpointMapping() {
AnnotationActionEndpointMapping mapping = new AnnotationActionEndpointMapping();
return mapping;
}
}
但对于我的用例,我有两个需要处理的 wsdl 文件。最初我设置了一个 RestController 并从 xml POST 请求中解组了正文,但我现在想尝试纯弹簧方式。
我假设我需要创建两个 MessageDispatcherServlet,每个 wsdl 定义一个,但我不知道如何正确映射或注册我的端点。
有什么想法吗?
摆弄我创建了重复的(具有不同的 wsdl 和 bean 名称)WSDLdefinition bean,messageDispatcherServlet 到ServletRegistrationBean 给了我错误Servlet messageDispatcherServlet was not registered (possibly already registered?),而我的端点似乎出现了,但是 spring 返回一个 404对上述端点的任何请求。
Spring-ws 版本:3
【问题讨论】:
标签: java spring soap spring-ws endpoint