Re: xmlrpclib - methodHelp doesn't work



srinivasanr@xxxxxxxxx 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
.



Relevant Pages

  • Re: Include a in a .c file
    ... You have not posted the error messages you are getting. ... And the snippet that you posted is correct. ... Prev by Date: ...
    (microsoft.public.vc.stl)
  • Re: Connecting to gnuplot with Popen?
    ... Anton81 writes: ... here is a little snippet using os.popen: ... Unfortunately I'm having more problem getting the output from Gnuplot, ... I'd like to examine for error messages and settings of options. ...
    (comp.lang.python)
  • Re: Connecting to gnuplot with Popen?
    ... here is a little snippet using os.popen: ... Unfortunately I'm having more problem getting the output from Gnuplot, ... I'd like to examine for error messages and settings of options. ...
    (comp.lang.python)