SOAP with Python

To evaluate a SOAP service, I decided to increase my Python skills by one by consuming the SOAP service with Python. SOAP Web Services from Dive Into Python seemed a quite good starting point with detailed instructions for setting up your Python environment to do so.

After starting to work thought this article how to install the required SOAP libraries, I realized quickly links are broken and various information became obsolete. Therefore, I decided to summarize the amendments to set up SOAP libraries for Python, in this article focusing on how to set up PyXML, fpconst and SOAPpy.

PrerequisitesBefore starting lets be sure Python is installed. You might check with

where python

to determine which python will be accessed via the PATH variable.In my case it is a Python 2.7 running on Windows 8.0.

Run through the installer, just make sure, you pick the right Python installation during the process.

Verifying the installation is quite simple using the Python console, though.

>>> import xml
>>> xml.__version__
'0.8.4'
>>

fpconstInstead of picking up the fpconst package from Unversity of Washington’s broken link, you’ll meanwhile find fpconst 0.7.2 within the Python Package Index. Download and extract the archive to any temporary folder. Change folders to the extracted one and run

python setup.py install

from the console.

Again very the installed package with

>>> import fpconst
>>> fpconst.__version__
'0.7.2'
>>>

SOAPpySOAPpy is probably the package causing the most headache. I first picked SOAPpy 0.12.0_rc1 from the download section at http://pywebsvcs.sourceforge.net/. It caused more or less trouble, trying to install the package. In addition, SOAPpy was announced to be merged into the ZSI (Zolera SOAP Infrastructure) web service toolkit. If you are going to try ZSI anyway, download and installation are similar to the example above using

which will compile quite a bunch of stuff on your local machine. Follow the instructions, and add the C:\Python27\Scripts to your PATH variable.

Once installation is complete, you will find an easy_install.exe program in your Python Scripts subdirectory. For simple invocation and best results, add this directory to your PATH environment variable, if it is not already present.