views:

82

answers:

1

Hi all,

I used WCF to create a restful web service in .NET, by means of a .svc file. The web application automatically produces a WSDL file. AFAIK, the WADL is more natural for a restul web service.

How could I create a restful service in .NET (preferably with wcf) that produces a WADL description?

Note An answer like "RTFM" is accepted, as long as you indicate a suitable manual/tuturial.

Thanks.

+1  A: 

Forgive me for answering a question with a question, but do you really want to do REST? REST really has no need for things like WADL.


Update:

The "hypermedia constraint" (aka HATEOAS) dictates that the user agent discovers content based on links embedded in previously retrieved content. It really is unnecessary to have a separate document that describes all the available content.

Imagine using a web browser to go to a site and instead of going to the home page and navigating from there, you are presented with a page which is a list of all the URLs on the site. You must then looks through the list of available urls, choose the one you are interested in and copy it into the address bar.
WADL is effectively you list of site urls. You just don't need it if your main content is linked together.

Linking content instead of using a WADL "site map" has other advantages. The available links can be dynamic based on particular data values in the content. This capability can vastly reduce the complexity of clients, because the client no longer needs to host the logic to decide when it is allowed to follow a link.

Darrel Miller
As wikipedia says: "The Web Application Description Language (WADL) is an XML-based file format that provides a machine-readable description of HTTP-based web applications.[...]The purpose of WADL is to allow services on the internet (or any other IP network) to be described in a machine processable way, to make it easier to create Web 2.0 style applications and create a dynamic way of creating and configuring services. Prior to this, it was necessary to go to an existing web service, study it and write the application manually."
lmsasu
Hence the question... while a WSDL can be easily used by tools like svcutil, I also expect to be able to produce a WADL document which might be useful for a developer. WSDL is claimed to fit more natural to a restful WS that WSDL. Did I get it wrong?
lmsasu
I see your answer from http://stackoverflow.com/questions/2689122/how-to-generate-restful-client-in-java-for-rest-defined-in-wsdl/2691081#2691081 - and the comment "If clients depend on service descriptions obtained at design time your system is anything but RESTful" - I guess this is what you mean?
lmsasu
@imsasu Yes WADL is a closer fit to RESTful web services than WSDL. I still don't think it is necessary or even advantagous. See my updated answer.
Darrel Miller