Learning rest together (11) -- restful documentation: WSDL and wadl

Source: Internet
Author: User
Tags css validator wsdl

Original address: http://rest.elkstein.org/

Learn rest: a tutorial

WSDL (Web Services Description Language)Which is proposed by W3C and is usually used by the SOAP server to describe the services it can provide. The Service binding options of WSDL are flexible (for example, services can be provided through the SMTP Mail Server), except for get and post, HTTP operations are not supported. Since the rest service usually uses HTTP actions, such as put and delete, it is obviously inappropriate to select WSDL as the document description of the rest service.

In version 2.0, WSDL supports all HTTP actions. Therefore, it can be considered as a document description of the rest service.

The second option is wadl (Web application Description Language ). Wadl is dominated by Sun and similar to rest. wadl is lightweight, easy to understand, and easier to write. In some respects, wadl is not flexible in WSDL (not bound to the SMTP service), but it is sufficient for rest and has fewer actions.

The following is a segment of wadl describing Amazon's "iten serch" service:

<Method name = "get" id = "itemsearch"> <request> <Param name = "service" style = "query" fixed = "awsecommerceservice"/> <Param name =" version "style =" query "fixed =" 2005-07-26 "/> <Param name =" operation "style =" query "fixed =" itemsearch "/> <Param name =" subscriptionid" style = "query" type = "XSD: string "required =" true "/> <Param name =" searchindex "style =" query "type =" AWS: searchindextype "required =" true "> <option value =" books "/> <option value =" DVD "/> <option value =" Music "/> </param> <param name = "keywords" style = "query" type = "AWS: keywordlist "required =" true "/> <Param name =" responsegroup "style =" query "type =" AWS: responsegrouptype "repeating =" true "> <option value =" small "/> <option value =" medium "/> <option value =" large "/> <option value =" images "/> </param> </request> <response> <representation mediatype =" text/XML "element =" AWS: itemsearchresponse "/> </response> </method>

As we can see, most of the formats are obscure. the type-safe XMLSCHEMA type enriches rest.

    • The length of the entire document is onlyCodeThere are about 10 lines of fragments (including XML Naming rules and Schema syntax reference). You can see in wadl specifications.
    • Click W3C unicorn project specifications to view the wadl document of the CSS validator service.

Some rest advocates, however, find even the lightweight wadl to be an overkill. And indeed, most rest services are already ented by no more than a textual description (a human-readable HTML file ).

Some rest advocates find that lightweight wadl is sufficient. In fact, most rest service documents are text descriptions (human-readable HTML files ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.