Reputation: 416
I'm learning how to use SOAP, what I want to do basically consists of making a web page using SOAP with Spring MVC to retrieve data from a database. I've been studying how to use Spring MVC but I don't understand how I can make it SOAP. Basically, how to structure it? What to use? Should I use Spring-WS alongside Spring MVC? I must say I'm pretty new in Spring MVC and SOAP.
I really appreciate any given help.
Upvotes: 1
Views: 3976
Reputation: 1287
Below are the steps you need to take
Need to add below dependencies
spring-ws-core wsdl4j
create an xsd which stands for XML Schema Definition. Your domain will be in schema file (XSD) that Spring-WS will export automatically as a WSDL.
Generate domain classes based on an XML schema. It can be done using maven plugin
Create some kind of db repository which would serve the data to the web service
Create a service endpoint to use the repo. It is done so that we don't expose the logic to the user we just give the service name that should be called. service handles everything for us. Kind of abstraction
Configure web service beans. Below is the link to a detailed tutorial to make a spring based soap web service
http://www.concretepage.com/spring-4/spring-4-soap-web-service-producer-consumer-example-with-tomcat
Upvotes: 3