Tcl and standards for remote procedure calls
Tcl offers packages for both clients and servers of various standards. Even though this book focuses on XML-RPC and SOAP, Tcl also supports other standards, such as JSON-RPC, SOAP over SMTP, and can easily be used for REST interfaces—using JSON, XML, and other formats for passing data.
The previous chapter shows how to implement such an interface using Tcl's dictionaries. Using XML would only require using the tDOM
package, which was described in Chapter 5. JSON, which stands for JavaScript Object Notation is an open standards based, widely used web application which is derived from JavaScript. Currently, the Tcl package json
only offers functionality for mapping JSON to Tcl dictionaries. Creating json responses requires us to create our own code for writing to JSON data.
For XML-RPC we'll be using the Tcl package XMLRPC
available from http://tclsoap.sourceforge.net/. These packages are also available in the ActiveTcl distribution so all the packages...