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