xml-rpc module question
Scott Hathaway
slhath at home.com
Tue Dec 19 00:28:41 EST 2000
Hello,
I have taken the xml-rpc module and added the following to the call area:
def CubeIt(x):
return x**3
def call(self, method, params):
if method == 'CubeIt':
return CubeIt(params)
And, I call this with the following client call:
import xmlrpclib as x
testing = x.Server('http://localhost')
print testing.CubeIt(3)
And I get the following error:
C:\Projects\core>python core_client.py
Traceback (most recent call last):
File "core_client.py", line 7, in ?
print testing.CubeIt(3)
File "xmlrpclib.py", line 547, in __call__
return self.__send(self.__name, args)
File "xmlrpclib.py", line 630, in __request
request
File "xmlrpclib.py", line 585, in request
return self.parse_response(h.getfile())
File "xmlrpclib.py", line 601, in parse_response
return u.close()
File "xmlrpclib.py", line 371, in close
raise apply(Fault, (), self._stack[0])
xmlrpclib.Fault: <Fault 1: "exceptions.NameError:There is no variable named
'CubeIt'">
Can anyone help me out? I am sure that I am not creating the CubeIt
function properly. I am totally lost.
Thanks,
Scott
More information about the Python-list
mailing list