Learn how to create a SOAP webservice with JAX-WS RI and Spring Boot.
What to do
Use spring initializr to create a Spring Boot application with Spring Web dependency.
Open your pom.xml and include jaxws-rt (the runtime) and jaxws-spring (a helper library for integrating jaxws-rt with Spring). Exclude the Spring dependencies from jaxws-spring to avoid conflicts.
Application class, by importing an xml config file (jaxwsconfig.xml) which contains bean wiring for JAX-WS RI and register
WSSpringServlet to receive incoming requests.
GreetingService class which greets the client upon being called. You will reference the service by the name later to let it handle the web service requests.
Lastly, you have to add an xml file for wiring the service on the endpoint:
Now open http:/localhost:8080/hello?wsdl to see the generated wsdl file. Your webservice has been deployed, and you could now create a client for it.
What to do next?
Here are some hints what topics you could explore next.
- Test your webservice with SoapUI
- Find out, why you should write your service contract (wsdl) first and not the code
- Learn how to develop a service “contract-first” with JAX-WS RI
- See what other alternatives to RI are available