|
|
Python sample codes
Sample python/Zope code for calling Person.Basic :
import xmlrpclib, httplib
from base64 import encodestring
from string import split, join, lower, replace
url='http://www.care2x.net/foundry/modules/hxp/server.php'
function='Person.Basic'
switch={'verbose':1}
auth={'usr':'hxp','pw':'hxp'}
parameters=[auth,'10000000']
server=xmlrpclib.Server[url]
f=server.__getattr__(function)
try:
res=apply(f,parameters)
print(res)
except:
print(parameters)
res=apply(f,parameters)
Courtesy of Dr. Andrew Ho (OIO)
|