How To Get Stuff Done on the Web


I have been known to say that putting a method inside the SOAP body (aka RPC), and transferring it over an application protocol such as HTTP, is a bad thing. Here, I will explain why, in my usual rambling fashion ...

The meaning of POST

From the definition of HTTP POST in RFC 2616, we have this relevant snippet;

The actual function performed by the POST method is determined by the server [...]

This can be described in at least two ways;

"So how does stuff get done with POST?"

The way you buy a book on the Web is not by asking a service to "buyBook()" for you. At some point (by GET or POST - normally GET) you find yourself in a state where you know that if you POST a particular kind of document to a particular URI, that the result will be that a book is purchased. With HTML, this expectation is formed in the mind of a human with an HTML form.

A good comparison is where the word "post" originally came from; the postal mail system. If I fill out a purchase order for some shoes, and "post" it in a mailbox addressed to "P.O. Box 3333, Springfield", I cannot expect shoes to arrive. What makes it possible for me to form that expectation, and indeed to treat that expectation as a contract, is if I receive first hand knowledge from this party that they take shoe orders and send people shoes in return (rather than, say, shred the order and mail it back to me).

It also works a lot like drag-and-drop on a desktop. You form an expectation in your mind that dragging a file on a trashcan means "delete", because simply seeing that icon instills in your head the expectation that it behaves like a real trash can.

"So how does the Semantic Web fit?"

What, you didn't ask that question? Well too bad. 8-)

The Semantic Web permits machines to operate exactly the same way as humans do, by basically replacing HTML forms with machine processable information in RDF, and allowing them to form expectations based on RDF type interactions. For example, in Notation3;

@prefix rdf: <> .

<> rdf:type <> .

which says that "Mike's Shoes" has a resource which accepts shoe orders in a manner compliant with the Shoe Standards Organization's standard. The neat part of RDF and the Semantic Web is that I can build a purchasing agent that knows nothing about shoes. How this is done, is if asserts that its standard reuses a more generic standard. So if I did a GET on I might see something like this;

@prefix rdfs: <> .

<> rdfs:subClassOf <> .

That says exactly what I said above; that this shoe order acceptor resource, is a sub class (in an OO sense) of a more generic order acceptor.

-- Mark Baker