Skip to content

OGo Docs

Sections
Personal tools
You are here: Home » Members » whitemice's Home » Misc. Stuff. » Making OGo XML-RPC calls from Jython using Apache XML-RPC

Making OGo XML-RPC calls from Jython using Apache XML-RPC

Document Actions
Making OGo XML-RPC calls from Jython using Apache XML-RPC
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'])
Created by whitemice
Last modified 2007-10-23 09:18 PM
 

Powered by Plone

This site conforms to the following standards: