Создание WebService, использующего протокол Soap 1.2 с Springbot 2.x - PullRequest
0 голосов
/ 20 марта 2020

Существуют ли какие-либо специальные функции при настройке Spring-Ws при создании веб-службы, использующей протокол SOAP -1.2 при работе с SpringBoot 2.x ?

Что еще мне добавить и почему? Где информация об этом?

@EnableWs
@Configuration
public class WebServiceConfig {

    private static final String NAMESPACE_URI = "http://..../apps";

    @SuppressWarnings({"rawtypes", "unchecked"})
    @Bean (name = "apsMessage")
    public ServletRegistrationBean messageDispatcherServlet(ApplicationContext appContext){

        MessageDispatcherServlet servlet = new MessageDispatcherServlet();

        servlet.setApplicationContext(appContext);
        servlet.setTransformWsdlLocations(true);
        return new ServletRegistrationBean(servlet, "/ws/*");
    }


    @Bean(name = "apps")
    public DefaultWsdl11Definition defaultWsdl11Definition(@Qualifier("appsSchema") XsdSchema schema){

        DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();

        wsdl11Definition.setPortTypeName("ApsPort");

        wsdl11Definition.setLocationUri("/ws");

        wsdl11Definition.setTargetNamespace(NAMESPACE_URI);

        wsdl11Definition.setSchema(schema);

        wsdl11Definition.setCreateSoap11Binding(true);
        wsdl11Definition.setCreateSoap12Binding(true);

        return wsdl11Definition;
    }

    @Bean(name = "appsSchema")
    public XsdSchema moviesSchema(){

        return new SimpleXsdSchema(new ClassPathResource("xsd/schema-apps.xsd"));

    }
}
...