Reputation: 621
Is it possible to develop both SOAP and REST webservice in single application using spring boot or spring mvc. I have been looking for some example but not able to find.
For Example: myWebAddress is my application
Passing XML request through SOAPUI to my application by hitting SOAP URL(http://ww.mywebaddress.com/soap)
Passing request as parameter to same application by hitting REST URL(http://ww.mywebaddress.com/soap?parameter)
If possible, could you provide some simple example or link to any example.
Thanks in Advance!!
Upvotes: 8
Views: 13787
Reputation: 14943
Yes, you can create two web service types for the same Spring web application, but you have to be careful with namespaces.
For SOAP, you will publish a WSDL and use an end point. The WSDL will be consumed and a client web service call will be generated on the calling side.
Check this example for soap
For RESTFUL, you will create a @RestController
with a @RequestMapping
.
Check this example for rest
Also, read:
Can I use SOAP Webservices and Spring MVC together
Both REST and SOAP Web Services for a single application
Can I use Spring MVC and Spring WS in one single application?
Upvotes: 9