On Jan 2, 2004, at 10:35 AM, David Forslund wrote:
>
> One has to negotiate an agreement on the semantics of a request. If
> there is no mechanism
> to establish this semantic exchange, then the service is essentially
> useless.
Very true ... for RESTful services, distributed objects, and SOAP/WSDL
interfaces as well. Even those services that publish a syntactic
interface such as CORBA IDL or WSDL have to explicitly or implicitly
publish the semantic definition of the exchange, or it is indeed
useless. As an obvious example, "price" is meaningless unless the
currency, terms of sale, quality guarantees, return policy, etc. are
understood by both parties, and all the IDL and WSDL definitions in the
world won't do the job. (OK, you could add more fields such as
"terms", "currency", etc. to the interface, but that would beg all
sorts of semantic questions ... sooner or later the strings and numbers
and dates have to map onto some human concepts).
In a sense, REST is just saying that the WSDL for all services is
functionally equivalent to the HTTP spec -- you have the "uniform
interface" methods of GET, PUT, POST, DELETE [or some other small
uniform set, let's not go there]. The details of the syntax of the
messages exchanged is not defined by REST, but by the same sort of
implicitly or explicitly negotiated agreements that are used to
exchange understandings of the semantics of IDL or WSDL definitions.
So, REST decouples the *operations* in an interface from the
syntax/semantics of the messages exchanged; CORBA and SOAP/WSDL lump
the operations and syntax of the interface together ... and yes,
decouples that from the semantics.
Real-world RESTifarians tend to use a plain schema definition (as
opposed to a WSDL description that combines the operations/ports with a
schema definition) of the messages, so in one sense the answer to the
question "what is the REST equivalent of WSDL" is that it is a schema
definition of the data to be PUT, POSTED, or GETted. RESTifarians
also tend to be Semantic Web advocates, so they would actually try to
formally define the *semantics* of the service, which AFAIK few CORBA
or SOAP/WSDL users even try to do.
I *do* have a philosophical issue with REST, or at least Mark's
assertions about the "uniform interface principle." I think that all
this stuff -- URI of endpoints, protocol for exchanging data, agreement
on the syntax of the data exchanged, and the implicit or explicit
semantics of what is supposed to happen -- is the "interface". That is
NOT uniform across services, unless you just say that what is
transferred is a bag of bits that humans can somehow make sense of of
after being rendered by an application that understands the MIME type
of the content. So, perhaps the human-oriented Web has a "uniform
interface", but I can't imagine a service-oriented Web that could make
that claim.
> An example of how a client discovers a REST service and invokes it and
> uses the results would be
> illustrative of the issue.
>
Indeed. I wish the RESTifarians would use more nontrivial concrete
examples. I've talked to the Propylon (Sean's company) people enough
to believe that they really have a bunch of real success stories, but I
don't have them available to me. The best, most concrete discussions I
know of are Paul Prescod's articles a couple of years ago on XML.com
that, for example, illustrate how a RESTful equivalent of UDDI would
work
http://webservices.xml.com/pub/a/ws/2002/02/06/rest.html
http://webservices.xml.com/pub/a/ws/2002/02/20/rest.html