Primeri uporabe web servisa za Python in SOAP knjižico SUDS, ki jo namestimo z:
sudo easy_install suds
Nadozrni modul skrbi za dostop do naprave.
from suds.client import Client
client = Client(url)
url = 'http://<webservice_host>/lidar/LIDAR?wsdl'
api_key = 'api_key'
username = 'username'
password = 'password'
auth_token = client.service.getAuthenticationToken(api_key, username, password)
if auth_token != None:
print 'Authenticated! Auth token: %s' % auth_token
lock_token = client.service.getLockToken(auth_token)
if lock_token != None:
print 'Locked! Lock token: %s' % lock_token
unlock = client.service.unlock(lock_token)
if unlock:
print 'Unlocked!'