[Zope] Zope2 and XMLRPC methods

Rowan Woodhouse rwoodhouse at wirelessmeasurement.com
Tue Feb 17 16:36:14 EST 2009


Hi,

I'm having some trouble getting XML-RPC methods going on Zope2/Five. 
I've got the following in my configure.zcml:

<configure
     xmlns="http://namespaces.zope.org/zope"
     xmlns:browser="http://namespaces.zope.org/browser"
     xmlns:five="http://namespaces.zope.org/five"
     xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc">

     <include package="zope.app.publisher.xmlrpc" file="meta.zcml" />
     <include package="zope.app.security" file="meta.zcml" />

     <xmlrpc:view
         for="MZCore.interface.IMZTag"
         methods="smeg"
         class="MZCore.MZTag.MZTag.MZTagXmlRpcInterface"
         permission="zope.Public"
         />

</configure>


and MZTag.py has the following in it:


from zope.app.publisher.xmlrpc import XMLRPCView

class MZTagXmlRpcInterface(XMLRPCView):

     def smeg(self):
         """something
         """
         return 'hello!'


But when I try to access the method via XML-RPC as follows (where aaa is 
and object that implements IMZTag)

 >>> s = ServerProxy('http://admin:admin@192.168.69.135:9673/aaa')
 >>> s.smeg()

I get an error back saying "Cannot locate object at: 
http://192.168.69.135:9673/aaa/smeg"

I'm at a loss now as what to try next. If I change the method name in 
either the configure.zcml or python files I get an error back saying 
that the method cannot be found when the .zcml file is parsed so I know 
it is being included.

Does anyone have any ideas?

Thanks,
Rowan



More information about the Zope mailing list