[Zope] Getting ZClass instances from Zope via XML-RPC ??

Dieter Maurer dieter@handshake.de
Wed, 13 Feb 2002 19:57:34 +0100


marq@europa.com writes:
 > I am wondering how to get ZClass instances from Zope to a Java XML-RPC client.
 > 
 > 1.
 > I have (and please forgive the Java-like pseudocode; i'm new to Python) a product with a ZClass call Invoice (meta = "Invoice Main")
 > class Invoice {
 > String invoice_name
 > int invoice_id
 > date invoice_date
 > }
 > 
 > 2.
 > I have a Python Script (named 'invoice') that goes:
 > results=[]
 > for object in context.Projects.objectValues('Invoice Main'):
 >   results.append(object)
 > return results
 > 
 > 3.
 > When i test this script directly in Zope, i get:
 > [<Project instance at 014A00F0>, <Project instance at 01832800>, <Project instance at 015A2D80>]
 > 
 > 4.
 > If i call this from my XML-RPC client, i get the following Java/Zope error:
 > 
 > Unexpected Zope exception: cannot marshal <extension class Acquisition.ImplicitAcquirerWrapper at 00C25140> objects 
The XML-RPC tries to serialize (Java terminology; its called
"marshal" in Python/Corba) the instances and it unable to do it.

Probably, you must convert your instances into something more
elementary to help the marshaling process.


Dieter