xmlrpc and ZSQL Method
hi there, after searching for 2 hours i try the community know-how. i want to access a ZSQL Method "prd_sql_method" with parameters: "fac_id_only:int" and "date:string" by xmlrpc. right now i do: s=xmlrpclib.Server('http://sino/ip') dict={} dict['fac_id_only']=1 dict['date']='1996-01-02' s.Zope.operate.xmlrpc.prd_sql_method() y[] for x in s: y.append(x) return str(y) ----------------------------------------------- how do i get parameters in? --------------------------------------------------------- i get an error message: "Unexpected Zope error value: ['fac_id_only', 'date']" -------------------------------------------------- how do i get results out? --------------------------------------------- got nothing yet :-) thanks for help olaf -- soli-con Engineering Zanger Dipl.-Ing. (FH) Olaf Marc Zanger Lorrainestrasse 23 3013 Bern / Switzerland Fon: +41-31-332 9782 Mob: +41-76-572 9782 mailto:info@soli-con.com mailto:olaf.zanger@soli-con.com http://www.soli-con.com
What your doing seems a complicated way to do it to me. Try something like import xmlrpclib s=xmlrpclib.Server('http://your.server.address') results=s.operate.xmlrpc.prd_sql_method(1,'1996-01-02') if len(results)>0: print 'we found records' else: print "we didn't find records" for record in results: print record[0] # print the first field Note that xmlrpc doesn't allow named parameters they must be positional. hth Phil On Saturday 05 May 2001 06:38, Olaf Zanger wrote:
hi there,
after searching for 2 hours i try the community know-how.
i want to access a ZSQL Method "prd_sql_method" with parameters: "fac_id_only:int" and "date:string" by xmlrpc.
right now i do:
s=xmlrpclib.Server('http://sino/ip')
dict={} dict['fac_id_only']=1 dict['date']='1996-01-02' s.Zope.operate.xmlrpc.prd_sql_method() y[] for x in s: y.append(x) return str(y)
----------------------------------------------- how do i get parameters in? --------------------------------------------------------- i get an error message: "Unexpected Zope error value: ['fac_id_only', 'date']"
-------------------------------------------------- how do i get results out? --------------------------------------------- got nothing yet :-)
thanks for help
olaf
participants (2)
-
Olaf Zanger -
Phil Harris