RESTServiceDescriptions

From MashupCamp

Jump to: navigation, search

Contents

Rest service description.

Mashup Camp 6, 3/19/2008

Led by Jonathan Marsh


Jonathan's background

  • Director of Architecture - Mashup Technologies, WSO2
  • XML at Microsoft, XSLT
  • Microsoft W3c rep, edited specs, xinclude, etc
  • Chair of WSDL working group.

Initial Agenda / Topics

  • WSDL 2.0 HTTP
  • WADL
  • JSON WSDL binding
  • JSON Schema Langnuage
  • mediatype/schematype

REST Intro

Jonathan provided a brief overview of Representational State Transfer (REST), and how it differs from SOAP and WS- . He also touched on the basics of WSDL and datatyping.

WS is more message oriented, REST is more resource oriented.

WSDL 2.0 And HTTP

In WSDL 2.0 there is a WSDL binding for HTTP. Not well known or deployed beyond Apache Axis and some IBM usage in their WS tooling. Jonathan thinks the HTTP binding is a reason to support WSDL 2.0.

WSDL 2.0 specifies a template syntax for URI's

e.g.:

    http://myservice.example.com/api/{opname}?

John ?? mentioned the possibility of adding a microformat or link/rel to point to service description.

Newton Chan [[1]] mentioned his Javascript WSDL parser code he developed for teaching purposes.

WADL

WADL is a much simpler specification, puts resources first rather than functions.

According to ??? of KAPOW, open KAPOW has implemented WADL service descriptions.

StrikeIron are also using WADL for their REST service descriptions.

REST Describe and Compile - WADL generator

http://tomayac.de/rest-describe/latest/RestDescribe.html

http://www.infoq.com/news/2007/06/rest-describe-compile

The Restful Web Service book (OReilly: Richardson/Ruby) includes WADL examples.


JSON WSDL binding

Is there any interest in a JSON WSDL binding ?

There is definitely interest in JSON as a media type, there didn't seem to be much interest in a JSON specific WSDL binding.

Benefits of JSON are primarily performance.

Downside is security issues related to evaluation of JSON/Javascript in the browser.

JSON schema language

JSON is not as flexible as XML, and doesn't support schemas.

WSO2 currently using XML to describe the JSON data structures.

It might be possible to come up with a schema description in JSON itself, along the lines of:

typing
######

simpleType : "string"
optional : "string?"
repeatable : "string*"

enumeration
###########

state : "az|ct|....|"

structure definition
####################

address : 
    {
    street: "string",
    city: "string",
    zip: "number"
    }

For more details, refer to WSO2 mashup server documentation, esp http://wso2.org/project/mashup/1.0.2/docs/dataBinding.html.

Personal tools