用于动态wsdl的Spring-ws支持内联xsd模式集合,例如,我们可以设置:
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
wsdl11Definition.setSchemaCollection(schemaCollection);
但是对于静态wsdl的内联模式集合呢?例如以下示例:
@Bean(name = "Service")
public SimpleWsdl11Definition simpleWsdl11Definition() {
SimpleWsdl11Definition simpleWsdl11Definition = new SimpleWsdl11Definition();
simpleWsdl11Definition.setWsdl(new ClassPathResource("wsdl/Service.wsdl"));
return simpleWsdl11Definition;
}
@Bean(name = "Schema")
public XsdSchema schema() {
return new SimpleXsdSchema(new ClassPathResource("xsd/Schema.xsd"));
}
当Schema.xsd不是简单的架构而是一个架构集合(它导入其他架构)时,如何公开XsdSchemaCollection? Service.wsdl和Schema.xsd都是从外部生成的,因此无法修改。