31 Dec 2018: Thank you to our knowledgeable and friendly forums users for another great year. We are aware of the uptick in spam accounts and are doing our best to ban these at first sight. Thank you for your patience!

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 :(

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.