Web Application Description Language

Last updated

The Web Application Description Language (WADL) is a machine-readable XML description of HTTP-based web services. [1] WADL models the resources provided by a service and the relationships between them. [1] WADL is intended to simplify the reuse of web services that are based on the existing HTTP architecture of the Web. [1] [2] It is platform and language independent and aims to promote reuse of applications beyond the basic use in a web browser. [1] WADL was submitted to the World Wide Web Consortium by Sun Microsystems on 31 August 2009 [1] , but the consortium has no current plans to standardize it [2] . WADL is the REST equivalent of SOAP's Web Services Description Language (WSDL), which can also be used to describe REST web services. [3]

Contents

Format

The service is described using a set of resource elements. Each resource contains param elements to describe the inputs, and method elements which describe the request and response of a resource. The request element specifies how to represent the input, what types are required and any specific HTTP headers that are required. The response describes the representation of the service's response, as well as any fault information, to deal with errors.

Example

The following listing shows an example of a WADL description for the Yahoo News Search application.

<applicationxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://wadl.dev.java.net/2009/02 wadl.xsd"xmlns:tns="urn:yahoo:yn"xmlns:yn="urn:yahoo:yn"xmlns:ya="urn:yahoo:api"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns="http://wadl.dev.java.net/2009/02"><grammars><includehref="NewsSearchResponse.xsd"/><includehref="Error.xsd"/></grammars><resourcesbase="http://api.search.yahoo.com/NewsSearchService/V1/"><resourcepath="newsSearch"><methodname="GET"id="search"><request><paramname="appid"type="xsd:string"style="query"required="true"/><paramname="query"type="xsd:string"style="query"required="true"/><paramname="type"style="query"default="all"><optionvalue="all"/><optionvalue="any"/><optionvalue="phrase"/></param><paramname="results"style="query"type="xsd:int"default="10"/><paramname="start"style="query"type="xsd:int"default="1"/><paramname="sort"style="query"default="rank"><optionvalue="rank"/><optionvalue="date"/></param><paramname="language"style="query"type="xsd:string"/></request><responsestatus="200"><representationmediaType="application/xml"element="yn:ResultSet"/></response><responsestatus="400"><representationmediaType="application/xml"element="ya:Error"/></response></method></resource></resources></application>

Generate WADL or generate code from WADL

Java

There are multiple tools to generate java code from an existing WADL: [4] [5]

Example WADL Generated by CXF

<appxmlns="http://research.sun.com/wadl/2006/10"xmlns:xs="http://www.w3.org/2001/XMLSchema"><grammars><xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"attributeFormDefault="unqualified"elementFormDefault="unqualified"><xs:elementname="appProfile"type="appProfile"/><xs:elementname="customerProfile"type="customerProfile"/><xs:complexTypename="customerProfile"><xs:sequence><xs:elementminOccurs="0"name="accessPaymentServicesEnabled"type="xs:boolean"/><xs:elementmaxOccurs="unbounded"minOccurs="0"name="attributes"nillable="true"type="attribute"/><xs:elementminOccurs="0"name="billingType"type="xs:string"/><xs:elementminOccurs="0"name="defaultCurrency"type="xs:string"/><xs:elementminOccurs="0"name="defaultSpendingLimitCurrency"type="xs:string"/><xs:elementminOccurs="0"name="maximumSpendingLimit"type="xs:double"/><xs:elementminOccurs="0"name="minimumSpendingLimit"type="xs:double"/><xs:elementminOccurs="0"name="customerCategory"type="xs:string"/><xs:elementminOccurs="0"name="customerEnabled"type="xs:boolean"/><xs:elementminOccurs="0"name="customerName"type="xs:string"/><xs:elementminOccurs="0"name="paymentNotificationEndpointAddress"type="xs:string"/><xs:elementminOccurs="0"name="pseCustomerId"type="xs:string"/><xs:elementminOccurs="0"name="resourceURL"type="xs:string"/><xs:elementminOccurs="0"name="settlementContractUuid"type="xs:string"/><xs:elementminOccurs="0"name="isSpendingLimitEnabled"type="xs:boolean"/><xs:elementminOccurs="0"name="abcCustomerId"type="xs:string"/></xs:sequence></xs:complexType><xs:complexTypename="attribute"><xs:sequence><xs:elementminOccurs="0"name="key"type="xs:string"/><xs:elementminOccurs="0"name="value"type="xs:string"/></xs:sequence></xs:complexType><xs:complexTypename="appProfile"><xs:sequence><xs:elementminOccurs="0"name="appEnabled"type="xs:boolean"/><xs:elementminOccurs="0"name="appName"type="xs:string"/><xs:elementminOccurs="0"name="appPassword"type="xs:string"/><xs:elementminOccurs="0"name="appUserName"type="xs:string"/><xs:elementminOccurs="0"name="appUuid"type="xs:string"/><xs:elementmaxOccurs="unbounded"minOccurs="0"name="attributes"nillable="true"type="attribute"/><xs:elementminOccurs="0"name="description"type="xs:string"/><xs:elementminOccurs="0"name="customerName"type="xs:string"/><xs:elementminOccurs="0"name="resourceURL"type="xs:string"/><xs:elementminOccurs="0"name="serviceContractName"type="xs:string"/><xs:elementminOccurs="0"name="abcAppId"type="xs:string"/></xs:sequence></xs:complexType></xs:schema></grammars><resourcesbase="http://mpsamara-mobl-vm1:9078/customermanagement/v1"><resourcepath="/customers"><resourcepath="/"><methodname="DELETE"><request></request><response><representationmediaType="app/json"/></response></method><methodname="GET"><request><paramname="page"style="query"type="xs:int"/><paramname="partialCustomerName"style="query"type="xs:string"/></request><response><representationmediaType="app/json"/></response></method><methodname="POST"><request><representationmediaType="app/json"/></request><response><representationmediaType="app/json"/></response></method><methodname="PUT"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}"><methodname="DELETE"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}"><paramname="customerUserName"style="template"type="xs:string"/><methodname="GET"><request></request><response><representationmediaType="app/json"/></response></method><methodname="POST"><request><representationmediaType="app/json"/></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}"><methodname="PUT"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps"><methodname="DELETE"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps"><paramname="customerUserName"style="template"type="xs:string"/><methodname="GET"><request><paramname="page"style="query"type="xs:int"/></request><response><representationmediaType="app/json"/></response></method><methodname="POST"><request><representationmediaType="app/json"/></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps"><methodname="PUT"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps/{appName}"><methodname="DELETE"><request></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps/{appName}"><paramname="customerUserName"style="template"type="xs:string"/><paramname="appName"style="template"type="xs:string"/><methodname="GET"><request></request><response><representationmediaType="app/json"/></response></method><methodname="POST"><request><representationmediaType="app/json"/></request><response><representationmediaType="app/json"/></response></method></resource><resourcepath="/{customerUserName}/apps/{appName}"><methodname="PUT"><request></request><response><representationmediaType="app/json"/></response></method></resource></resource></resources></app>

See also

Related Research Articles

XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.

A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML, choosing the appearance of a page, or jumping to positions in multimedia content.

Representational state transfer (REST) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave. The REST architectural style emphasises the scalability of interactions between components, uniform interfaces, independent deployment of components, and the creation of a layered architecture to facilitate caching components to reduce user-perceived latency, enforce security, and encapsulate legacy systems.

Apache Wicket, commonly referred to as Wicket, is a component-based web application framework for the Java programming language conceptually similar to JavaServer Faces and Tapestry. It was originally written by Jonathan Locke in April 2004. Version 1.0 was released in June 2005. It graduated into an Apache top-level project in June 2007.

JSON-RPC is a remote procedure call protocol encoded in JSON. It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications and for multiple calls to be sent to the server which may be answered asynchronously.

Catalogue Service for the Web (CSW), sometimes seen as Catalogue Service - Web, is a standard for exposing a catalogue of geospatial records in XML on the Internet. The catalogue is made up of records that describe geospatial data, geospatial services, and related resources.

Security Assertion Markup Language 2.0 (SAML 2.0) is a version of the SAML standard for exchanging authentication and authorization identities between security domains. SAML 2.0 is an XML-based protocol that uses security tokens containing assertions to pass information about a principal between a SAML authority, named an Identity Provider, and a SAML consumer, named a Service Provider. SAML 2.0 enables web-based, cross-domain single sign-on (SSO), which helps reduce the administrative overhead of distributing multiple authentication tokens to the user.

JSONP, or JSON-P, is a historical JavaScript technique for requesting data by loading a <script> element, which is an element intended to load ordinary JavaScript. It was proposed by Bob Ippolito in 2005. JSONP enables sharing of data bypassing same-origin policy, which disallows running JavaScript code to read media DOM elements or XMLHttpRequest data fetched from outside the page's originating site. The originating site is indicated by a combination of URI scheme, host name, and port number.

The W3C's XML Schema Recommendation defines a formal mechanism for describing XML documents. The standard has become popular and is used by the majority of standards bodies when describing their data.

Jakarta RESTful Web Services, is a Jakarta EE API specification that provides support in creating web services according to the Representational State Transfer (REST) architectural pattern. JAX-RS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints.

POST (HTTP)

In computing, POST is a request method supported by HTTP used by the World Wide Web. By design, the POST request method requests that a web server accept the data enclosed in the body of the request message, most likely for storing it. It is often used when uploading a file or when submitting a completed web form.

EMML, or Enterprise Mashup Markup Language, is an XML markup language for creating enterprise mashups, which are software applications that consume and mash data from variety of sources, often performing logical or mathematical operations as well as presenting data. Mashed data produced by enterprise mashups are presented in graphical user interfaces as mashlets, widgets, or gadgets. EMML can also be considered a declarative mashup domain-specific language (DSL). A mashup DSL eliminates the need for complex, time-consuming, and repeatable procedural programming logic to create enterprise mashups. EMML also provides a declarative language for creating visual tools for enterprise mashups.

Data Format Description Language, published as an Open Grid Forum Proposed Recommendation in January 2011, is a modeling language for describing general text and binary data in a standard way. A DFDL model or schema allows any text or binary data to be read from its native format and to be presented as an instance of an information set.. The same DFDL schema also allows data to be taken from an instance of an information set and written out to its native format.

Fuzzy Markup Language (FML) is a specific purpose markup language based on XML, used for describing the structure and behavior of a fuzzy system independently of the hardware architecture devoted to host and run it.

Yesod is a free and open-source web framework based on Haskell for productive development of type-safe, REST model based, high performance web applications, developed by Michael Snoyman et al.

gSOAP is a C and C++ software development toolkit for SOAP/XML web services and generic XML data bindings. Given a set of C/C++ type declarations, the compiler-based gSOAP tools generate serialization routines in source code for efficient XML serialization of the specified C and C++ data structures. Serialization takes zero-copy overhead.

ActiveVFP is a server-side scripting framework designed for Web development to produce dynamic Web pages. Similar to PHP, but using the native Visual Foxpro (VFP) language and database, ActiveVFP can also be used in Model-View-Controller (MVC) web applications as well as RESTful API. ActiveVFP is completely free and open source and does not require the purchase of Microsoft Visual FoxPro or any additional software.

The RESTful Service Description Language (RSDL) is a machine- and human-readable XML description of HTTP-based web applications.

The Brutos Application Framework is MVC controller written in Java. Designed to reduce the complexity of web development, with configurable mapping, view resolution as well as support for uploading and downloading files. Can be configured using XML, annotations and CoC.

PATCH (HTTP) Request method supported by the HTTP protocol

In computing, the PATCH method is a request method supported by the Hypertext Transfer Protocol (HTTP) protocol for making partial changes to an existing resource. The PATCH method provides an entity containing a list of changes to be applied to the resource requested using the HTTP Uniform Resource Identifier (URI). The list of changes are supplied in the form of a PATCH document. If the requested resource does not exist then the server may create the resource depending on the PATCH document media type and permissions. The changes described in the PATCH document must be semantically well defined but can have a different media type than the resource being patched. Languages such as XML, JSON can be used in describing the changes in the PATCH document.

References

  1. 1 2 3 4 5 Sun Microsystems (31 August 2009). "Web Application Description Language: W3C Member Submission 31 August 2009". World Wide Web Consortium . Retrieved 12 August 2012.
  2. 1 2 World Wide Web Consortium (14 October 2009). "Team Comment on the "Web Application Description Language" Submission". World Wide Web Consortium . Retrieved 12 August 2012.
  3. Lawrence Mandel (29 May 2008). "Describe REST Web services with WSDL 2.0: A how-to guide". IBM . Retrieved 12 August 2012.
  4. github WADL project
  5. Apache CXF