On Jul 04, 2009 at 17:30, Juha Heinanen <jh(a)tutpro.com> wrote:
i wrote in python a simple text that sends
domain_reload command over s
xmlrpc interface to sr:
[...]
T 2009/07/04 17:20:02.455358 127.0.0.1:33418 ->
127.0.0.1:6060 [AP]
<?xml
version='1.0'?>.<methodCall>.<methodName>domain_reload</methodName>.<
params>.</params>.</methodCall>.
##
T 2009/07/04 17:20:02.455718 127.0.0.1:6060 -> 127.0.0.1:33418 [AP]
HTTP/1.0 200 OK..Via: SIP/2.0/TCP 127.0.0.1:33418..Server: SIP Route
r (2.99.0-dev01-serk (i386/linux))..Content-Length: 274....<?xml version="1
.0"?>.<methodResponse>.<fault>.<value>.<struct>.<member>.<name>faultCode</n
ame>.<value><int>500</int></value>.</member>.<member>.<name>faultString</na
me>.<value><string>Method Not
Found</string></value>.</member>.</struct>.</
value>.</fault>.</methodResponse>
however, python client program does not terminate until after more
than 2 minutes. then it finally prints:
The reply looks ok to me. I've tried quickly writing an xmlrpc in perl
(using XMLRPC::Lite) and tested using core rpcs and it works both with
normal answers and with faults.
E.g:
time perl ~/sr.git/xmlrpc_test.pl foobar
fault{
faultCode: 500
faultString: Method Not Found
}
real 0m0.240s
Traceback (most recent call last):
File "sr-xmlrpc.py", line 15, in <module>
erg = c.domain_reload()
File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
verbose=self.__verbose
File "/usr/lib/python2.5/xmlrpclib.py", line 1201, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.5/xmlrpclib.py", line 1340, in _parse_response
return u.close()
File "/usr/lib/python2.5/xmlrpclib.py", line 787, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 500: 'Method Not Found'>
i also tested with a php xmlrcp client with same result.
any idea why it takes so long and why parsing of response fails? is
something missing from the response?
I don't know why is taking so long (especially since the reply is sent
immediately after the request). However I don't think the parsing fails.
I'm not familiar with python xmlrpc, but
xmlrpclib.Fault: <Fault 500: 'Method Not Found' looks ok given the
reply.
You get a fault reply because you try to call domain_reload which does
not exist (the correct rpc name is domain.reload).
Andrei