我正在SpringBoot SOAP WS项目上工作,我必须对传入的请求进行xsd验证,我有3个WSDL(意味着要验证3个URL),但是不幸的是,我能够做一个。在下面的代码中,addInterceptors()添加了hotelDirectUpdateSchema(),与此类似,我还有2个xsd。
如何处理3个请求验证?

@EnableWs
@Configuration
public class WSConfiguration extends WsConfigurerAdapter {
    @Bean
    public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
        MessageDispatcherServlet servlet = new MessageDispatcherServlet();
        servlet.setApplicationContext(applicationContext);
        servlet.setTransformWsdlLocations(true);
        return new ServletRegistrationBean(servlet, "/service/*");
    }
    @Override
    public void addInterceptors(List<EndpointInterceptor> interceptors) {
        PayloadValidatingInterceptor validatingInterceptor = new PayloadValidatingInterceptor();
        validatingInterceptor.setValidateRequest(true);
        validatingInterceptor.setValidateResponse(true);
        validatingInterceptor.setXsdSchema(hotelDirectUpdateSchema());
        interceptors.add(validatingInterceptor);
    }
}

最佳答案

我能够在下面解决它是解决方案

10-08 12:50