python webservices

I noticed Tomas is doing a OC15 workshop on webservices... using python [1]! Really cool and I look forward to it.

I also wrote a python 3 client [2], at about the same time it seems. It is one class whose methods are the SOAP calls. It is just for the SOAP methods at the moment, since I'm still on 3.1.4.1. :(

Sadly, XML isn't cool any more with the cool kids, so most of the python SOAP libraries out there seem to be dead or broken. Initially I'd tried to use suds but the amount of overriding required meant it was easier to roll my own with requests (for sending), xmltodict (for xml to dict and back) and etree (for building the SOAP envelope), plus a logger. There's an integration test suite - to run them you need to specify the instance location, username, password and study identifier in oc_ws_test_generic. The tests will read the study metadata to create subjects and import data and stuff so don't point it at something where that would be a problem. Lastly, I made all expected exceptions and call failures go silently and write the failure to the log, because it was intended for use with website integration or scheduled tasks.

This discussion has been closed.