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

marq@europa.com marq@europa.com
Tue, 12 Feb 2002 13:20:00 -0500


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 
 org.apache.xmlrpc.XmlRpcException: Unexpected Zope exception: cannot marshal <extension class Acquisition.ImplicitAcquirerWrapper at 00C25140> org.apache.xmlrpc.XmlRpcException: Unexpected Zope exception: cannot marshal <extension class Acquisition.Impl
icitAcquirerWrapper at 00C25140> objects

	at org.apache.xmlrpc.XmlRpcClient$Worker.execute(Unknown Source)
	at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
	at TreeExpandEventDemo.init(TreeExpandEventDemo.java:49)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


It seems that it's not getting actual instances, but references to them. I don't know. 

I am assuming that the results array of objects above should come back as a Java hashtable, per this page:
http://xml.apache.org/xmlrpc/types.html

Anyone explain what's going on and how i get the ZClass instances (or Python class instances) out of Zope and into my little applet?? 

Thanks much!
mark



------------------------------------------------------------
  Sent via Marzie's Toolbox (http://www.marzie.com)  
------------------------------------------------------------