Developer Resources’s Weblog

June 9, 2008

Python web service using SOAPPy

Filed under: Examples, Python, Web Services — Tags: , , , — developerresources @ 5:10 am

Here is an example of how to call a WebService from Python. For more information on Python and Web Services I recommend the following book: Python Cookbook.

This requires the fpconst and SOAPPy package. You can download them from http://research.warnes.net/projects/RStatServer/fpconst/ and http://prdownloads.sourceforge.net/pywebsvcs/SOAPpy-0.11.6.tar.gz?download. Unzip the packages then run python setup.py install on each package.

The following code will then connect to the web service and execute the remote method.

import sys

#Import the ZSI client
from SOAPpy import WSDL

url = 'http://webservices.daehosting.com/services/isbnservice.wso?WSDL'
server = WSDL.Proxy(url);
print server.IsValidISBN13(sISBN ='0000000000000')

Note there is another web service package called ZSI, I found SOAPPy to be easier to use, but from what I understand both packages are going to merge together.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.