As you can see, such response contains two sections: an RDF container embedded in the HTML
<script> element, and the usual HTML body. The RDF part is meant to be parsed by a programmatic client, while the HTML payload is presumably to be read by humans. Apart from that, the two sections contain the very same pieces of information, just formatted differently. The machine-oriented section contains one single
<result> tag, named
response.1 as an RDF resource, and that resource contains an ordered list (array) of string-type values (only one in this stripped-down example, but there could be more, and they could be of mixed types, not just strings).

Explaining how RDF works is ouside the scope of this manual so I won't get into the details here, but the above should give you the general idea. The example shown is a bit artificial, as a real-world response will normally contain more RDF stuff and possibly a larger HTML
<body>. Here is what the actual response page from the same
Hell oWorld program will look like in the reality:

This more realistic examples shows that a real response contains quite a bit of stuff, to cope with other meta-data that are used in practise, such as Copyright stuff for both the web service and the response template (the latter may contain copyrighted elements, especially in the human-oriented HTML body). Other sections deal with the interface definition (IDL) of the requested service, the echoing of call parameters back to the client for debugging purposes, and so on. Given the triviality of the
Hello World example, even the real-world version of the response does not show every possible meta-data that a typical CSA response can convey. Often the called program can take parameters, as it is the case with the following sample "calendar" program than can optionally be passed year/month values:

If we call
http://www.example.com/cgi-bin/cgiwrap/goofy/CSA?0=example.calendar&year=2004&month=8 with a Web browser (after replacing the relevant parts of the URL with your local setup), here's what we will see if we ask our browser to show us the HTML source code of the response page:

Now, all this may seem overkill for carrying simple stuff as the one shown in the examples, and maybe it really is. On the other hand it is XML that is often criticised as being needlessly verbose, so blame it, not me
. As the dialog between the client and the server gets more articulated, however, the overhead introduced by XML/RDF becomes proportionally smaller and the overall usefulness of the above mechanism starts to emerge.
Trackbacks (0) |
New trackback |
Print