Page 1 of 1

Request: example how to use (OpenKM) webservices

PostPosted:Thu Dec 04, 2008 12:09 pm
by peter
hi,

i have some experience in programming (c++, c#). but i have never used webservices.
i have no idea where to begin and how to use a webservice in particular the OpenKM one.

i have read trough the OpenKM documentation and the webservice specs. i have also search the internet about webservice. i now understand what it is and what is possible.

i hope that somebody will be kind enough to post a complete working example on how to use the OpenKM webservice. for example: how to create a new folder in the OKM/root folder using webservice?

any help will be very appreciated thanks

Re:Request: example how to use (OpenKM) webservices

PostPosted:Tue Dec 09, 2008 12:02 pm
by pavila
This is a simple client using Python:
Code: Select all
from SOAPpy import WSDL

wsdlAuth = \'http://localhost:8080/OpenKM/OKMAuth?wsdl\'
wsdlSearch = \'http://localhost:8080/OpenKM/OKMSearch?wsdl\'
sAuth = WSDL.Proxy(wsdlAuth)
sSearch = WSDL.Proxy(wsdlSearch)

token = sAuth.login(arg0=\'user\', arg1=\'pass\')
print \'Token: \'+token

xpath = \'/jcr:root/okm:root//element(*,okm:document)[jcr:contains(@okm:keywords,\\\'document\\\')]\'
findByStatementResponse = sSearch.findByStatement(arg0=token, arg1=xpath, arg2=\'xpath\');

sAuth.logout(arg0=token)

for queryResult in findByStatementResponse[\'value\']:
	print queryResult
It search creating a custom XPath query.