[Zope] calling a product with xmlrpc

Reinoud van Leeuwen reinoud.v at n.leeuwen.net
Tue Apr 11 11:54:35 EDT 2006


Hi,

I have a working Pyhton script to search for users in a plone site with a 
commandline xmlrpc client. It cannot be changed into an external method 
because of the fact that it only works when running under a role with 
sufficient rights.
So I turned it into a product.

Basically I have (I have deleted some obvious code):

class Xmlrpcindex(UniqueObject, SimpleItem):
    security = ClassSecurityInfo()
    security.declarePublic('search')

    def search (self, SearchableText):
	return 'foobar'

The product is recignized as a Zope product and Plone product. It is 
installed in my Plone instance and I have made an instance in my Plone 
root (with id my_xmlrpc_instance).

So the client looks like this:

import xmlrpclib
server = xmlrpclib.Server('http://localhost/plonesite/my_xmlrpc_instance')
results = server.search('sometext')


This however generates a NotFound Exception :-(

Am I doing something elementary wrong? Should I call the search method in 
another way?

>From the ZMI error log:

User Name (User Id) Anonymous User (None)
Request URL         http://localhost/plonesite/my_xmlrpc_instance/search
Exception Type 	    NotFound
Exception Value     http://localhost/plonesite/my_xmlrpc_instance/search

Traceback (innermost last):

    * Module ZPublisher.Publish, line 92, in publish
    * Module ZPublisher.BaseRequest, line 344, in traverse
    * Module ZPublisher.HTTPResponse, line 640, in debugError



-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen    reinoud.v at n.leeuwen.net
http://www.xs4all.nl/~reinoud
__________________________________________________


More information about the Zope mailing list