tags:

views:

1055

answers:

5

To describe restful we can say Every resource has its own URI. Using HTTP GET,POST,PUT,DELETE we can parse these resources. All the resources are representational. Who wants to use our resources, can just use it from browser. that's all the main idea of restful. This architecture or architectural style allow services on the internet. So why this architecture needs Wadl. What does WADL do and HTTP doesn't? why there is WADL?

A: 

REST specifies nothing about WADL.

Wahnfrieden
I think so, but Wadl can use inside of the rest for example http://www.youtube.com/watch?v=cDdfVMro99s . It seems that wadl supports clients to use server's function. And clients can just need to have parameters and the name of the function.
Iguramu
What you just described to me sounds like RPC, not REST.
Wahnfrieden
+1  A: 

WADL appeals to people coming from the SOAP world where it is common to use a code generator to create client side code based on the WSDL. I don't think that mechanism is useful in REST as it creates client code that is coupled to server endpoints.

I believe that if you properly define your media-types and use hypermedia within those media-types, then it is not necessary to have WADL. The description of the available end-points is contained within the media-type definitions themselves. And if you are now saying to yourself, but application/xml doesn't contain any information about available hyperlinks, then I say BINGO. That's why I don't think application/xml and application/json are appropriate media-types for REST. I'm not saying don't use XML or JSON, just don't use the generic media type name.

The other appeal of WADL is for the purpose of documenting REST services. Unfortunately, it leads developers down the wrong path as WADL attempts to document server-side end points. Documenting a REST services should focus primarily on the media-types. A client developer should be able to write a REST client without knowing any url other than the root url.

Darrel Miller
WADL also appeals to those who have a boss who says you have to have a formal definition in a standard format. I'm not saying it's the best way to do that, just that some times it's useful to "check an organizational box", so to speak. That fact that it's overkill can be lost upon one's boss. However, having the formal def file can save you from being shoved back to the SOAP crack pipe that all the other cool corporate kids are sucking on.
Roboprog
@Roboprog Document your media types instead of the end points. There are plenty of good examples at the IANA registry. Also, the Sun Cloud API is a good example. You have to convince your boss that documenting the endpoints is a bad idea for the future.
Darrel Miller
+6  A: 

Using WADL implies that you just might be gracious enough to actually define the data / documents you are passing back and forth. Say you are passing some XML fragments, they might actually be part of a defined schema.

Whether or not you use the DL to generate code is not very important to me. What matters, in my subjective opinion, is that it is important to have a formal agreement on interfaces between business partners. Even if what is passed is obvious, it helps to identify who has to fix what later if somebody changes the previous interface.

Data format is just as much a part of an interface as verb names.

Roboprog
Using REST requires that you define the data / documents you are passing back and forth. The problem with WADL is that it also tries to define the end-points which should not be part of the API definition.
Darrel Miller
+4  A: 

WADL sucks - stop reading about it and move on. There's a reason it hasn't really caught on.

Gandalf
+2  A: 

WADL allows you to generate code, tests and documentation. Actually there are few very useful tools utilizing WADL, you can see some examples here. The problem with the "pure" REST, as described in Fielding's dissertation, is writing clients supporting Hypermedia (imagine writing Java Swing-based client application for example). With WADL this task is completely automated, and it's a huge advantage in my view. Testing becomes a way easier too.