xmlrpclib - methodHelp doesn't work

S

srinivasanr

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.

Traceback (most recent call last):
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'meerkat' is not defined

</snip>

can someone tell me what is wrong.

Also is there any good online resource for XML-RPC with Python.
 
K

Kent Johnson

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.

Traceback (most recent call last):


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,241
Messages
2,571,219
Members
47,849
Latest member
RoseannKoz

Latest Threads

Top