Параметры в XSD определяются следующим образом:
Код: Выделить всё
Код: Выделить всё
@Endpoint
@RequiredArgsConstructor
public class DataEndpoint {
private static final String NAMESPACE_URI = "http://www.machine-config.net/namespace/data";
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getData")
@ResponsePayload
public GetDataResponse getData(@RequestPayload GetData request) {
}
}
Код: Выделить всё
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet messageDispatcherServlet = new MessageDispatcherServlet();
messageDispatcherServlet.setApplicationContext(applicationContext);
messageDispatcherServlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(messageDispatcherServlet, "/ws/*");
}
@Bean(name = "dataDefinition")
public DefaultWsdl11Definition dataWsdl11Definition() {
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
wsdl11Definition.setPortTypeName("dataServicePortType");
wsdl11Definition.setLocationUri("/ws");
wsdl11Definition.setTargetNamespace("http://www.machine-config.net/namespace");
wsdl11Definition.setSchemaCollection(dataSchemas());
return wsdl11Definition;
}
@Bean(name = "dataSchema")
public XsdSchemaCollection dataSchemas() {
CommonsXsdSchemaCollection xsds = new CommonsXsdSchemaCollection(new ClassPathResource("xsd/data-2.18.1433.2.xsd"));
xsds.setUriResolver(new DefaultURIResolver());
xsds.setInline(true);
return xsds;
}
}
Код: Выделить всё
Когда я меняю xsd:element getData на getDataRequest генерируется элемент wsdl:input.
Но этот обходной путь не сработает, поскольку XSD будет предоставлен поставщиком, и мне не разрешено ничего менять в этом файле.Как я могу сделать Spring-ws распознавать входной параметр без суффикса запроса?
Подробнее здесь: https://stackoverflow.com/questions/773 ... ter-suffix