Keith has created a nice REST demo to show how WSDL 2.0 can be used to describe a RESTful interaction, and posted the resulting mashup here. This is in response to an old post he found from Stefan Tilkov.
One of the area Stefan explores is the difference between the conceptual models of "operations" versus "resources":
It seems to me that the right thing would be to get rid of the operations (or map them to the HTTP verbs, which is essentially the same thing as getting rid of them).
Keith indeed mapped each combination of "verb", "uri template" into a WSDL operation. So what Stefan describes as "GET on /customer/{id} - get customer details" Keith maps to a "getCustomerDetails" operation which takes an "id" parameter. I think this is a very reasonable mapping, and one that looks a lot like the "getCustomerDetails(id)" construct which is present in some form in every programming language.
I don’t call this "getting rid of the operations" either, if by that is meant writing a WSDL that has only four operations (GET, PUT, POST, DELETE). I would instead say that an operation encapsulates the combination of the http method, the http location uri pattern or template, and the input and output types into a construct that maps well to familiar programming constructs and provides a level of abstraction that can prove valuable (e.g. the uri location can change, security can be applied, even the transport protocols can change without perturbing the development experience).
Having a WSDL 2.0 description of the service in terms of operations also had the beneficial effect of documenting which combinations of verb/uri template are supported, with the effect of also documenting which combinations aren’t supported. Stefan had to notate these as "unused" in his diagram, important because some of the combinations aren’t obvious (why can’t a customer be deleted?)
It still baffles me why there isn’t more demand for WSDL 2.0 and its REST description features. Hopefully Keith’s post helps demonstrate the value of this technology.
