[Zope] Can't get "objectIds()" (and others) from XML-RPC

Gilles Lenfant glenfant@bigfoot.com
Fri, 11 May 2001 12:12:04 +0200


Hi group...

I'm trying to use XML-RPC server features of ZOPE using Fredrik Lundh's
xmlrpclib and the BasicAuthTransport class explained in Amos Latteier's
Howto http://www.zope.org/Members/Amos/XML-RPC.

I've tried to do some stuffs explained in Amos's article at
http://www.xml.com/lpt/a/2000/01/xmlrpc/index.html

I succeeded reading a DTML document with server.document_src() but when
trying to get a folder objects list, like in the example:

<python>
from xmlrpclib import Server
from BasicAuthTransport import BasicAuthTransport
srv = xmlrpclib.Server('http://localhost:8080/anyfolder',
BasicAuthTransport('myself', 'mypassword'))
print srv.objectIds()    # raises the xmlrpclib.Fault exception
</python>

I got always this exception !

<console>
Traceback (most recent call last):
  File "./userlist.py", line 10, in ?
    print srv.objectIds()
  File "/usr/lib/python2.1/site-packages/xmlrpclib.py", line 539, in
__call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.1/site-packages/xmlrpclib.py", line 622, in
__request
    request
  File "./BasicAuthTransport.py", line 46, in request
    return self.parse_response(h.getfile())
  File "/usr/lib/python2.1/site-packages/xmlrpclib.py", line 593, in
parse_respo
nse
    return u.close()
  File "/usr/lib/python2.1/site-packages/xmlrpclib.py", line 367, in close
    raise apply(Fault, (), self._stack[0])
xmlrpclib.Fault: <Fault -2: 'Unexpected Zope error value:
<html><head><title>D
...
</TD>\n\n<TD WIDTH="90%">\n  <H2>Site Error</H2>\n  <P>An error was
encountered while publishing this resource.
</P>\n  <P><STRONG>Resource not found</STRONG></P>
Sorry, the requested resource does not exist.<p>Check the URL and try
again.<p>
<!--
http://localhost:8080/anyfolder/objectIds
-->
<HR NOSHADE>
<P>Troubleshooting Suggestions</P>\n\n  <UL>\n  <LI>T
he URL may be incorrect.</LI>\n  <LI>The parameters passed to this resource
may
</console>

"objectIds" method is not the only one that raises an exception.
When using methods inherited from class "ObjectManagerItem", it works but I
got similar exception when using other methods inherited from class
"ObjectManager". As mentioned in the API doc, a folder is supposed to be a
subclass of "ObjectManagerItem" and "ObjectManager".

Did I miss something ?

Thanks in advance for any hint.