minusSeven
minusSeven

Reputation: 234

How to produce a soap web service in spring boot ?

I was following this tutorial of producing soap web service in spring boot,

and it left me a little confused. Like where is the wsdl in the first place ? Is this going to generate the wsdl from the countries.xsd ? I didn't get how it is expected to test web service in soapui without having a wsdl file.

Can anyone help me out.

Upvotes: 4

Views: 6201

Answers (2)

Prateep Gedupudi
Prateep Gedupudi

Reputation: 399

Here are the basic 5 steps to produce SOAP web service with Spring Boot.

  1. Create an XML schema to define the domain
  2. Generate domain classes based on an XML schema
  3. Create repository
  4. Create service endpoint
  5. Configure web service beans

For in detail guide, have look on below blog post and youtube video.

https://prateep.info/2017/12/12/basic-5-steps-to-produce-soap-web-service-with-spring-boot/ https://www.youtube.com/watch?v=SiFSNtDAIS0&t=277s

Upvotes: 1

Jaydeep Rajput
Jaydeep Rajput

Reputation: 3673

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

http://<host>:<port>/ws/countries.wsdl

To get the country response

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

Below is the request.xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:gs="http://spring.io/guides/gs-producing-web-service">
   <soapenv:Header/>
   <soapenv:Body>
      <gs:getCountryRequest>
         <gs:name>Spain</gs:name>
      </gs:getCountryRequest>
   </soapenv:Body>
</soapenv:Envelope>

Upvotes: 2

Related Questions