How to create a soap website service in spring boot?

I followed this tutorial while producing a soap webservice in spring boot .

and it confused me a little. How and where is wsdl in the first place? This will generate wsdl from countries.xsd? I didn't understand how testing a web service in soapui is expected without a wsdl file.

Can anyone help me.


source to share

3 answers

For this tutorial, they have followed the Bottom-Up approach. If you want to get WSDL in this example



To get the country response

$ curl --header "content-type: text/xml" -d @request.xml http://localhost:8080/ws


Below is request.xml

<soapenv:Envelope xmlns:soapenv=""




Found a nice tutorial along with a video explanation for a top-down approach where we first create a wsdl and then use wsdl to generate the required classes. Using these classes, we then expose the webservice endpoint.

Using the maven-jaxb2-plugin, we can generate the required classes needed from wsdl.



Next, using the ServletRegistrationBean, we register the MessageDispatcherServlet with Spring Boot. During this registration, the URI template for the servlet is set to / javainuse / ws / *. Using this path, the web container will map incoming HTTP requests to the MessageDispatcherServlet. DefaultWsdl11Definition provides standard WSDL 1.1 using the specified WSDL Hello World file. The MessageDispatcherServlet also automatically detects any WsdlDefinition defined in the application context.

Ref- Spring First Boot Contract Example + SOAP Web Services



Here are the basic 5 steps to create a SOAP web service using Spring Boot.

  • Create XML Schema for Domain Definition
  • Generating Domain Classes from XML Schema
  • Create repository
  • Create service endpoint
  • Configuring the beans web service

See the blog post and YouTube video below for a detailed guide. SiFSNtDAIS0 & t = 277s



All Articles