REST teenuste kirjeldamine

Download Report

Transcript REST teenuste kirjeldamine

Describing REST
services
Ivo Malve
23.03.2015
Using WSDL to describe REST APIs
WSDL is flexible in service binding
options, it did not originally support HTTP
operations other than GET and POST. Since
REST services often use other HTTP verbs, such
as PUT and DELETE, WSDL was a poor choice
for documenting REST services.
• With
version 2.0, WSDL supports all HTTP verbs
and it is now considered to be an acceptable
method of documenting REST services. Link
http://rest.elkstein.org/2008/02/documenting-restservices-wsdl-and-wadl.html
• While
The need for proper REST API
documentation
increasing number of Web-based
enterprises (Google, Yahoo, Amazon, Flickr
to name but a few) are developing HTTPbased applications that provide
programatic access to their internal data.
http://www.w3.org/Submission/wadl/
• An
Textual documentation
these applications are
described using textual
documentation that is sometimes
supplemented with more formal
specifications such as XML schema for
XML-based data formats.
http://www.w3.org/Submission/wadl/
• …Typically
Examples of textual documentation
• Twitter
• Tesla
APIs
Model S
 Awesome example
http://rest.elkstein.org/2008/02/real-restexamples.html
• Flickr
APIs
Web Application Description Language
is designed to provide a machine
process-able description of such HTTP-based
Web applications.
• W3
WADL style
http://www.w3.org/Submission/wadl/
• …WADL
Summary
WSDL
 Flexible (binding to SMTP servers)
 Complex
•
WADL




•
Lightweight (no envelope)
Easier to understand
Easier to write
Sufficient for any web service
XRD
http://stackoverflow.com/questions/2215646/differencebetween-wsdl-2-0-wadl-xrd
•
Thank You!
Questions?