[EMAIL PROTECTED] wrote:
> I tried out the examples in this website for XML-RPC using python -
> http://www.onlamp.com/pub/a/python/2000/11/22/xmlrpcclient.html?page=2
> But I get the following errors when I try to execute the code. Here is
> the snippet of the code with the error messages.

>>>>meerkatsvr.system.methodSignature(meerkat.getChannels)
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'meerkat' is not defined
> 
>>>>meerkatsvr.system.methodHelp(meerkat.getItems)
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'meerkat' is not defined

You have to give the method names as strings. Your code is looking for a 
'getChannels' or 'getItems' attribute of something named 'meerkat', but there 
is no such name in the current scope. Try this:

Type "help", "copyright", "credits" or "license" for more information.
 >>> import xmlrpclib
 >>> meerkatURI = "http://www.oreillynet.com/meerkat/xml-rpc/server.php";
 >>> meerkatsvr = xmlrpclib.Server(meerkatURI)
 >>> meerkatsvr.system.listMethods()
['meerkat.getChannels', 'meerkat.getCategories', 
'meerkat.getCategoriesBySubstring', 'meerkat.getChannelsByCategory', 
'meerkat.getChannelsBySubstring', 'meerkat.getItems', 'system.listMethods', 
'system.methodHelp', 'system.methodSignature']
 >>> print meerkatsvr.system.methodSignature('meerkat.getChannels')
[['array']]
 >>> print meerkatsvr.system.methodHelp('meerkat.getItems')
Returns an array of structs of RSS items given a recipe struct.
<etc>

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to