8

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 restful 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/tutorial.

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
lmsasu
  • 7,459
  • 18
  • 79
  • 113

3 Answers3

8

This is an old question but having consumed restful services with WADLs they do offer some value. You can import them straight into SOAPUI and it will build a test suite for you automatically. Secondly they tend to contains all the required XSDs for XML based services and are useful for automatically building serialisable classes that your endpoints accept and receive.

Ben Robinson
  • 21,601
  • 5
  • 62
  • 79
  • This is a very useful answer. If you know about some tutorials on this topic, feel free to add them to the answer above. – lmsasu Sep 06 '13 at 09:13
  • 1
    Sorry i have just found these things out through trial and error. In terms of Soap UI you just create a new project and then select a WADL file the same way you would select a WSDL for a SOAP service.. – Ben Robinson Sep 06 '13 at 17:35
  • 3
    I thought this question was asking how to generate a WADL instead of a WSDL in .NET. Do you have a solution for that? – crush Feb 03 '15 at 22:13
4

Looks like REST Describe & Compile should do the trick.

On the WADL developer site Marc Hadley maintains a command line tool named WADL2Java. The ambitious goal of REST Describe & Compile is to provide sort of WADL2Anything. So what REST Describe & Compile does is that it:

  • Generates new WADL files in a completely interactive way.
  • Lets you upload and edit existing WADL files.
  • Allows you to compile WADL files to source code in various programming languages.
Jeff Swensen
  • 3,513
  • 28
  • 52
0

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
  • 139,164
  • 32
  • 194
  • 243
  • 4
    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 Sep 22 '10 at 06:49
  • 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 Sep 22 '10 at 06:52
  • 1
    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 Sep 22 '10 at 08:36
  • 1
    @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 Sep 22 '10 at 12:36