Search code examples
web-servicesspring-mvccxfjax-wsspring-ws

Exposing existing Spring MVC REST as SOAP


We have implemented a project based on Spring MVC REST, which also has Spring Security. Now we have a client who is only SOAP compliant (To implement SOAP we want to use Apache CXF), so we have two options.

  1. Write and Adapter Service which takes SOAP as incoming request, converts them to JSON calls and vice-versa.
  2. Expose the existing Spring MVC REST Service as both SOAP and REST.

Concern for option-1 is that if writing an adapter service just to support new SOAP protocol is worth it? Regarding Option-2 I am yet to come across an example which shows Spring MVC REST service exposed as SOAP/WSDL approach.

Thank you, Himalay


Solution

  • I followed the second approach, as with the first approach there is lot of duplication, I would follow the first approach if you have a matured REST framework used by many clients, and avoid introducing any bugs.

    enter image description here