[Zope] using a ZCatalog via xmlrpc

Andreas Jung Andreas Jung" <andreas@andreas-jung.com
Tue, 13 Aug 2002 11:46:54 +0200


The data returned by searchResults() can not be marshalled since
they contain non-basic data structures like IOBTreeItems that can not
be transported using XMLRPC. I suggest to wrap the searchResults
into a PythonScript or an external method and convert the result
to basic datatypes likes lists, dictionaries ....

-aj
----- Original Message -----
From: "Sylvain Thénault" <Sylvain.Thenault@logilab.fr>
To: "Zope Mailing list" <zope@zope.org>
Sent: Tuesday, August 13, 2002 10:04
Subject: [Zope] using a ZCatalog via xmlrpc


> hello,
>
> is there some way to use a ZCatalog via xmlrpc ?
> The following example raises an exception :
>
> import xmlrpclib
> import xmlrpc
> transport = xmlrpc.BasicAuthTransport(username='user',password='pass')
> url = 'http://intranet.logilab.fr:9673/RevuePresse/'
> server = xmlrpclib.Server(url, transport, encoding='iso-8859-1')
> server.Catalog.searchResults()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.2/xmlrpclib.py", line 821, in __call__
>        return self.__send(self.__name, args)
>   File "/usr/lib/python2.2/xmlrpclib.py", line 975, in __request
>        verbose=self.__verbose
>   File "xmlrpc.py", line 51, in request
>        return self.parse_response(result)
>   File "/usr/lib/python2.2/xmlrpclib.py", line 896, in parse_response
>        return u.close()
>   File "/usr/lib/python2.2/xmlrpclib.py", line 571, in close
>        raise apply(Fault, (), self._stack[0])
> xmlrpclib.Fault: <Fault -1: "Unexpected Zope exception: cannot marshal
>     <type 'IOBTreeItems'> objects">
>
> any ideas ? sample of working code ?
> TIA
>
> --
> Sylvain Thénault
>
>   LOGILAB           http://www.logilab.org
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )