Unlike the other code in this book, this chapter relies on libraries that do not come pre-installed with Python.
Before you can dive into SOAP web services, you'll need to install three libraries: PyXML, fpconst, and SOAPpy.
12.2.1. Installing PyXML
The first library you need is PyXML, an advanced set of XML libraries that provide more functionality than the built-in XML libraries we studied in Chapter 9.
If you are using Windows, there are several choices. Make sure to download the version of PyXML that matches the version of Python you are using.
Double-click the installer. If you download PyXML 0.8.3 for Windows and Python 2.3, the installer program will be PyXML-0.8.3.win32-py2.3.exe.
Step through the installer program.
After the installation is complete, close the installer. There will not be any visible indication of success (no programs
installed on the Start Menu or shortcuts installed on the desktop). PyXML is simply a collection of XML libraries used by other programs.
To verify that you installed PyXML correctly, run your PythonIDE and check the version of the XML libraries you have installed, as shown here.
Example 12.3. Verifying PyXML Installation
>>> import xml>>> xml.__version__'0.8.3'
This version number should match the version number of the PyXML installer program you downloaded and ran.
12.2.2. Installing fpconst
The second library you need is fpconst, a set of constants and functions for working with IEEE754 double-precision special values. This provides support for the
special values Not-a-Number (NaN), Positive Infinity (Inf), and Negative Infinity (-Inf), which are part of the SOAP datatype specification.
There are two downloads available, one in .tar.gz format, the other in .zip format. If you are using Windows, download the .zip file; otherwise, download the .tar.gz file.
Decompress the downloaded file. On Windows XP, you can right-click on the file and choose Extract All; on earlier versions
of Windows, you will need a third-party program such as WinZip. On MacOS X, you can double-click the compressed file to decompress it with Stuffit Expander.
Open a command prompt and navigate to the directory where you decompressed the fpconst files.
Type python setup.py install to run the installation program.
To verify that you installed fpconst correctly, run your PythonIDE and check the version number.
Example 12.4. Verifying fpconst Installation
>>> import fpconst>>> fpconst.__version__'0.6.0'
This version number should match the version number of the fpconst archive you downloaded and installed.
12.2.3. Installing SOAPpy
The third and final requirement is the SOAP library itself: SOAPpy.