Web services: XML-RPC, SOAP
XML-RPC is a technology that provides remote procedural calls to components
over networks. It routes requests over the HTTP protocol and ships data back and
forth packaged as XML text. To clients, web servers appear to be simple functions;
when function calls are issued, passed data is encoded as XML and shipped to
remote servers using the Web’s HTTP transport mechanism. The net effect is to
simplify the interface to web servers in client-side programs.
More broadly, XML-RPC fosters the notion of web services—reusable software
components that run on the Web—and is supported by Python’s xmlrpc.client
module, which handles the client side of this protocol, and xmlrcp.server, which
provides tools for the server side. SOAP is a similar but generally heavier web serv-
ices protocol, available to Python in the third-party SOAPy and ZSI packages,
among others.
CORBA ORBs
An earlier but comparable technology, CORBA is an architecture for distributed
programming, in which components communicate across a network by routing
calls through an Object Request Broker (ORB). Python support for CORBA is
available in the third-party OmniORB package, as well as the (still available though
not recently maintained) ILU system.
Java and .NET: Jython and IronPython
We also met Jython and IronPython briefly at the start of Chapter 7, in the context
of GUIs. By compiling Python script to Java bytecode, Jython also allows Python
scripts to be used in any context that Java programs can. This includes web-
oriented roles, such as applets stored on the server but run on the client when
referenced within web pages. The IronPython system also mentioned in Chap-
ter 7 similarly offers Web-focused options, including access to the Silverlight RIA
framework and its Moonlight implementation in the Mono system for Linux.
Screen scraping: XML and HTML parsing tools
Though not technically tied to the Internet, XML text often appears in such roles.
Because of its other roles, though, we’ll study Python’s basic XML parsing support,
as well as third-party extensions to it, in the next part of this book, when we explore
Python’s text processing toolkit. As we’ll see, Python’s xml package comes with
support for DOM, SAX, and ElementTree style XML parsing, and the open source
domain provides extensions for XPath and much more. Python’s html.parser li-
brary module also provides a HTML-specific parser, with a model not unlike that
of XML’s SAX technique. Such tools can be used in screen scraping roles, to extract
content of web pages fetched with urllib.request tools.
Windows COM and DCOM
The PyWin32 package allows Python scripts to communicate via COM on Win-
dows to perform feats such as editing Word documents and populating Excel
spreadsheets (additional tools support Excel document processing). Though not
related to the Internet itself (and being arguably upstaged by .NET in recent years),
Python Internet Development Options | 779