[Zope] xmlrpc and ZSQL Method

Olaf Zanger olaf.zanger@soli-con.com
Sat, 05 May 2001 22:02:50 +0200


hi there,

sorry phil for beeing so clueless as i am, but doing my best :-) ...

> return context.prd_sql_method(fac_id_only=fac_id_only,date=date)
what would "context" be?

i don't have a clue -- sorry



i tried an other way by External method with working pgsql access. i checked the
scirpt running from the directory without zope involved then it prints the following
as result:

production
----------
    89.888
(1 row)

a pprint(result) prints:
<pgqueryobject object at 8100c78>

which is not a string. 
i have no clue how to print this.

i thougth i can pass return result[22:33] to xmlrpc-client, but doesn't work either

so the problem seams


> 
> which takes the same parameters as your sql method.
> 
> I've done this my self so I know this works, if you can get the incantation
> right ;)
> 
> Luck be with you
> 
> Phil
> 
> On Saturday 05 May 2001 11:23, you wrote:
> > hi phil,
> >
> > thanks for trying to help,
> >
> > just i get the following error message . my Zsql-method uses these two
> > parameter names and the code is:
> >
> > ---------------------------
> > result=s.Zope.operate.xmlrpc.prd_sql_method(1, '1996-02-01') # error
> >
> > if len(results)>0:
> >     print 'found records: '
> > else:
> >     print 'no records'
> >
> > for record in results:
> >     print record[0]
> >
> >
> >
> > ---------------------
> >
> > Traceback (innermost last):
> >   File "./ip-prd_get-0.0.2.py", line 33, in ?
> >     result=s.Zope.operate.xmlrpc.prd_sql_method(1, '1996-02-01') # error
> >   File "./xmlrpclib.py", line 547, in __call__
> >     return self.__send(self.__name, args)
> >   File "./xmlrpclib.py", line 630, in __request
> >     request
> >   File "./xmlrpclib.py", line 585, in request
> >     return self.parse_response(h.getfile())
> >   File "./xmlrpclib.py", line 601, in parse_response
> >     return u.close()
> >   File "./xmlrpclib.py", line 371, in close
> >     raise apply(Fault, (), self._stack[0])
> > xmlrpclib.Fault: <Fault -2: "Unexpected Zope error value: ['fac_id_only',
> > 'date']">
> >
> > have a nice weekend
> >
> > 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