Difference between revisions of "Python client - OpenKM 5.1"
From OpenKM Documentation
(Created page with 'Category: Webservices Guide Category:OKM Network') |
|||
Line 1: | Line 1: | ||
+ | These sample code is using the SOAPpy library. If you are in a Debian based distro you can install it this way: | ||
+ | |||
+ | $ sudo aptitude install python-soappy | ||
+ | |||
+ | == Authentication == | ||
+ | |||
+ | <source lang="python"> | ||
+ | from SOAPpy import WSDL | ||
+ | |||
+ | # Register WSDL | ||
+ | sAuth = WSDL.Proxy('http://localhost:8080/OpenKM/OKMAuth?wsdl') | ||
+ | sSearch = WSDL.Proxy('http://localhost:8080/OpenKM/OKMSearch?wsdl') | ||
+ | |||
+ | # Login | ||
+ | token = sAuth.login(arg0='okmAdmin', arg1='admin') | ||
+ | print 'Token: '+token | ||
+ | |||
+ | #Logout | ||
+ | sAuth.logout(arg0=token) | ||
+ | </source> | ||
+ | |||
[[Category: Webservices Guide]] | [[Category: Webservices Guide]] | ||
[[Category:OKM Network]] | [[Category:OKM Network]] |
Revision as of 18:04, 9 March 2010
These sample code is using the SOAPpy library. If you are in a Debian based distro you can install it this way:
$ sudo aptitude install python-soappy
Authentication
from SOAPpy import WSDL
# Register WSDL
sAuth = WSDL.Proxy('http://localhost:8080/OpenKM/OKMAuth?wsdl')
sSearch = WSDL.Proxy('http://localhost:8080/OpenKM/OKMSearch?wsdl')
# Login
token = sAuth.login(arg0='okmAdmin', arg1='admin')
print 'Token: '+token
#Logout
sAuth.logout(arg0=token)