Joel Alvarez Myrrie
Joel Alvarez Myrrie

Reputation: 416

SOAP using Spring MVC, JAVA

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

Answers (1)

LearningPhase
LearningPhase

Reputation: 1287

Below are the steps you need to take

  1. Need to add below dependencies

    spring-ws-core wsdl4j

  2. 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.

  3. Generate domain classes based on an XML schema. It can be done using maven plugin

  4. Create some kind of db repository which would serve the data to the web service

  5. 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

  6. 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

Related Questions