After the brief presentation of php webservices, here’s how to play with SOAP and Python:
>>> from SOAPpy import SOAPProxy >>> url = 'http://rpolli@babel.it:password@horde.example.com:80/rpc.php' >>> n = 'urn:horde' >>> server = SOAPProxy(url, namespace=n)>>> server.config.dumpSOAPOut = 1
>>> server.config.dumpSOAPIn = 1
>>> calendars = server.calendar.list()
Steps are easy:
- set the namespace of the xml request: this is compulsory
- set I/O to verbose
- execute the call
You can list wsdl method with a similar way:
>>> from SOAPpy import WSDLÂ Â Â Â Â Â Â Â Â >>> wsdlFile = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl') >>> server = WSDL.Proxy(wsdlFile)Â Â Â >>> server.methods.keys() Examples are taken from: http://www.diveintopython.org/soap_web_services/index.html