[Zope] xmlrpc and ZSQL Method

Phil Harris phil.harris@zope.co.uk
Sun, 6 May 2001 13:54:19 -0400


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