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 Languages (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 document, choosing the appearance of a page, or jumping to positions in multimedia content.

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.

<span class="mw-page-title-main">Apache Tapestry</span> Open-source web application framework

Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006.

JSON-RPC is a remote procedure call (RPC) 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. SAML 2.0 was ratified as an OASIS Standard in March 2005, replacing SAML 1.1. The critical aspects of SAML 2.0 are covered in detail in the official documents SAMLCore, SAMLBind, SAMLProf, and SAMLMeta.

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, hostname, 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.

<span class="mw-page-title-main">POST (HTTP)</span> Request method in the HTTP protocol

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 accepts 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. These applications often perform logical or mathematical operations as well as present the data.

In computing, Open Data Protocol (OData) is an open protocol that allows the creation and consumption of queryable and interoperable Web service APIs in a standard way. Microsoft initiated OData in 2007. Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise. Version 4.0 was standardized at OASIS, with a release in March 2014. In April 2015 OASIS submitted OData v4 and OData JSON Format v4 to ISO/IEC JTC 1 for approval as an international standard. In December 2016, ISO/IEC published OData 4.0 Core as ISO/IEC 20802-1:2016 and the OData JSON Format as ISO/IEC 20802-2:2016.

Data Format Description Language is a modeling language for describing general text and binary data in a standard way. It was published as an Open Grid Forum Recommendation in February 2021, and in April 2024 was published as an ISO standard.

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.

<span class="mw-page-title-main">Yesod (web framework)</span>

Yesod is a web framework based on the programming language Haskell for productive development of type-safe, representational state transfer (REST) model based, high performance web applications, developed by Michael Snoyman, et al. It is free and open-source software released under an MIT License.

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.

<span class="mw-page-title-main">PATCH (HTTP)</span> Request method in the HTTP protocol

In computing, the PATCH method is a request method in HTTP 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 or 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