web-servicesspringwadl

Is it possible for Spring RESTful services to privde a WADL or something similar?


Situation:

We are planning to build a set of new services a long side a set of old SOAP (Spring, apache CXF) web services. Our customers are used to being able to use ?wsdl to get a wsdl describing a service and the content it will accept/return.

I'm looking at providing the new services via spring controllers and RESTful urls. However not all of a request can be handled via a RESTful url, so we still need to have a payload request and responses. I'm looking at use @RequestBody and @ResponseBody and spring's Message Converters to auto(magically) handle both XML and JSON content. The idea being to let spring do as much of the heaving lifting as possible.

The problem:

I'm trying to figure out if it's possible given the REST/Message converter concept, to be able to provide a description of a service and it's request/response data in a similar fashion to the ?wsdl request. I understand that there are WADL documents that can be generated by some systems, but they appear to be a proposel and not fully accepted yet.

Does anyone know if spring can generate WADLs or something else that I can use to allow clients to query the RESTful services data structures?


Solution

  • You could use CXF JAX-RS for your REST services since you're already using it for SOAP (you can even expose the same service as SOAP and REST with CXF), and CXF gives you the WADL that you want by adding ?_wadl&_type=xml