XMLRPC Quick Start Get Tech News from Meerkat
Meerkat is a public web application that aggregates technology news from hundreds of weblogs and news sites. It was one of the first web applications to expose a web service interface first a RESTlike interface and then an XML-RPC interface. Meerkat's XML-RPC interface is described at www.oreillynet.com pub a rss 2 0 00 11 14 meerkat_xmlrpc.html. Meerkat's API exposes access to three types of objects channels weblogs and news sites , categories groupings of channels , and items stories...
Summary Gty
This chapter introduced you to functions. Functions are a way of grouping a number of statements in Python into a single name that can be invoked any time that it's needed. When a function is defined, it can be created so that when it's invoked it will be given parameters to specify the values on which it should operate. The names of the parameters for a function are defined along with the function by enclosing them in parentheses after the function is named. When no parameters are used, the...
The BittyWiki XMLRPC API Document
The BittyWiki API server is located at http localhost 8001 . It exposes three methods bittywiki.getPage string pageName Returns the text of the named page. Passing an empty string designates the wiki home page. This will throw a fault if you request a page that doesn't exist. bittywiki.save string pageName, string text Sets the text of the named page. If the page doesn't already exist, it'll be automatically created. bittywiki.delete string pageName Deletes the named page. This will throw a...
Writing the BittyWiki Core
On the basis of those design decisions, it's now possible to write the core of BittyWiki the code that reads from and writes to the back-end, and that processes the WikiWord links. Put this code into BittyWiki.py, in your cgi-bin directory or somewhere in your PYTHON_PATH This module implements the BittyWiki core code that which is not bound to any particular interface. A class representing a wiki as a whole. HOME_PAGE_NAME HomePage Initializes a wiki that uses the provided base directory....
Web Service Etiquette
A web service may have users who skirt the rules, or administrators who feel the users are ungrateful for the service they're being provided. In the interests of harmony, here are a few basic pieces of advice for managing the social aspect of web services. If you write a robot to consume someone else's web services, it's important to play by the rules. In particular, don't try to evade any limitations such as license keys or daily limits on your access to the API. Access to a web service is a...
The XMLRPC Introspection API
An unofficial addendum to the XML-RPC specification defines three special functions in the system namespace, as a convenience to users who might not know which functions an XML-RPC server supports, or what those functions might do. These special functions are the web service equivalent of Python's ever-useful dir and help commands. Both SimpleXMLRPCServer and CGIXMLRPCRequestHandler support two of the three introspection functions, assuming you call the register_introspection_functions method...
If Something Goes Wrong
A REST web service is expected to flag error conditions using HTTP status codes, in conjunction with error documents that describe the problem. As you might expect, XML-RPC does a similar thing in a more structured way. If an XML-RPC server can't complete a request for any reason, it will return a response containing a fault, instead of one containing a return value in params. A sample fault response is as follows lt xml version 1.0 gt lt methodResponse gt lt fault gt lt value gt lt struct gt...
How It Works Gbt
The LDIF format LDAP Data Interchange Format is defined in RFC 2849 and is the standard text-based format for defining data and dumping data to and from LDAP databases and even specifying other arbitrary data changes, such as changes to and deletions of records. An LDIF file is divided into records by blank lines, and the first line of each record gives the distinguishing name the DN, or the key of the record affected. The default operation is addition, and the file defined previously simply...