Re: xmlrpclib - methodHelp doesn't work
- From: Kent Johnson <kent37@xxxxxxx>
- Date: Tue, 07 Jun 2005 13:54:21 -0400
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 .
- Follow-Ups:
- Re: xmlrpclib - methodHelp doesn't work
- From: srinivasanr@xxxxxxxxx
- Re: xmlrpclib - methodHelp doesn't work
- References:
- xmlrpclib - methodHelp doesn't work
- From: srinivasanr@xxxxxxxxx
- xmlrpclib - methodHelp doesn't work
- Prev by Date: Re: How do I know when a thread quits?
- Next by Date: DB API 2.0 and transactions
- Previous by thread: xmlrpclib - methodHelp doesn't work
- Next by thread: Re: xmlrpclib - methodHelp doesn't work
- Index(es):
Relevant Pages
|