[Zope-dev] Zope XML-RPC with SQL Methods
Eric Kidd
eric.kidd@pobox.com
Thu, 24 Jun 1999 09:40:26 -0400
On Wed, Jun 23, 1999 at 11:05:46AM -0400, Jim Fulton wrote:
> The short answer is no. (There is a longer answer that is a bit
> more ambiguous, but I'll spare you that. ;) Really, when doing xml-
> rpc, Zope should not try to use index_html. I'll fix this.
Thank you. I'd never understand how to fix this. :-)
> - The thing that marshals results need to be able to figure out
> how to marshal SQL method results. SQL methods return "result"
> objects, which are sequences of records. Records are objects that
> can be treated as mapping objects, sequences, or instances.
> Results need to be marshalled as xml-rpc arrays of structs. I'm
> not sure what protocols are needed to make this happen. I'll
> give this some thought.
Also, watch out for methods which return any of the following:
''
0
[]
Z ORB doesn't like values which evaluate to false, and won't successfully
return them via XML-RPC. This might occur if query results were empty, for
example. I'm trying to figure out how to fix this for XML-RPC without
breaking other parts of Zope.
> - SQL method expect parameters to be provided by name. Xml-rpc
> wants to provide parameters positionally. SQL methods would need
> to be changed to handle positional parameters.
I now have a wrapper product which allows positional parameters to be used
from DTML. This is a slight abuse of DTML, but allows XML-RPC wrappers to
be written through the web in the absence of Python TTW.
Cheers,
Eric