I have WSDL and schema files provided by client. I need to create Spring-boot SOAP web service with this WSDL file. I have google it and all the examples that I can find, th
First define the define XSD for Request and Response.
Then Configuring the Endpoint. (i.e Create a Bean class and a controller class)
Then Configure the Message Dispatcher Servlet to Receive the Request.
Then add wsdl4j dependency to the pom.xml.
Then add the web service config class as below.
@Bean(name = "students")
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema studentsSchema) {
DefaultWsdl11Definition definition = new DefaultWsdl11Definition();
definition.setPortTypeName("StudentPort");
definition.setTargetNamespace("http://in28minutes.com/students");
definition.setLocationUri("/ws");
definition.setSchema(studentsSchema);
return definition;
}
@Bean
public XsdSchema studentsSchema() {
return new SimpleXsdSchema(new ClassPathResource("student-details.xsd"));
}
Then if you start the spring boot and access the wsdl url then you can able to see the wsdl link. Please refer this blog[1] for detailed information.
[1] https://dzone.com/articles/creating-a-soap-web-service-with-spring-boot-start