import org.apache.xmlrpc.client as xmlrpc
from java.util import Vector
from java.util import Hashtable
import java.net
client = xmlrpc.XmlRpcClient()
config = xmlrpc.XmlRpcClientConfigImpl()
config.setServerURL(java.net.URL('http://***********/zidestore/so/***********/'))
config.basicUserName = '***********'
config.basicPassword = '***********'
client.setConfig(config)
qualifier = Hashtable()
qualifier['key'] = 'firstname'
qualifier['conjunction'] = 'AND'
qualifier['expression'] = 'LIKE'
qualifier['value'] = 'A%'
criteria = Vector()
criteria.add(qualifier)
params = Vector()
params.add('Contact')
params.add(criteria)
params.add(65535)
results = client.execute("zogi.searchForObjects", params)
for result in results:
print 'ObjectId:%s %s, %s' % (
result['objectId'],
result['lastName'],
result['firstName'])
This site is intended to be a central site for all projects in the OpenGroupware family. This include OpenGroupware Legacy (the Objective-C services), OpenGroupware Coils, Consonance, zOGI, Funambol's and Thunderbird's GroupDAV support, and others. If you have news about or experience with an OpenGroupware related project or product please let us know.
Showing posts with label jython. Show all posts
Showing posts with label jython. Show all posts
2010-07-20
Making zOGI XML-RPC API calls from Jython
Using zOGI from CPython is simple - you just use the "xmlrpc" module. However, that module relies on native [unmanaged] code so it doesn't work in Jython. In order to make XML-RPC calls from Jython you need to use a Java XML-RPC assembly: for example, the Apache XML-RPC assembly (previously known as "Helma") from the Apache foundation. Here is an example of making zOGI XML-RPC API calls from Jython:
Subscribe to:
Posts (Atom)