7

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

  1. Passing XML request through SOAPUI to my application by hitting SOAP URL(http://ww.mywebaddress.com/soap)

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

user6543599
  • 541
  • 2
  • 8
  • 18
  • Possible duplicate of [Can I use SOAP Webservices and Spring MVC together](http://stackoverflow.com/questions/17139533/can-i-use-soap-webservices-and-spring-mvc-together) – Sully Dec 18 '16 at 11:41
  • @HithamS.AlQadheeb Hi, Its not the thread which you have mentioned. I'd like to have both SOAP and REST webservices in single application. – user6543599 Dec 18 '16 at 11:45
  • which is http://stackoverflow.com/a/17140220/643500 SoapUI will take the WSDL URL for SOAP – Sully Dec 18 '16 at 12:13

1 Answers1

8

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?

Community
  • 1
  • 1
Sully
  • 14,672
  • 5
  • 54
  • 79