Author Topic: Does anyone have the XML RPC API working with 1.3.3?  (Read 7032 times)

chaag

  • Newbie
  • *
  • Posts: 11
  • Karma: 2
    • View Profile
    • Email
Does anyone have the XML RPC API working with 1.3.3?
« on: March 13, 2007, 01:12:14 »
Is the XML RPC still included in the latest builds? I can't seem to get this working, and it appears the file itself is simply missing:
chaag@phoneserver:/usr/local/queuemetrics/tomcat/webapps$ find . -name xmlrpc.do
chaag@phoneserver:/usr/local/queuemetrics/tomcat/webapps$

When I try to connect I get a 404 HTTP response
server_url = 'http://asterisk.ironport.com:8080/qm130/xmlrpc.do'

thanks

chris

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #1 on: March 14, 2007, 09:19:55 »
Hello,
it is correct that the file is missing, as URLs ending in .do are dynamic mappings and not jsp pages. But the dynamic mapping seems to be present in 1.3.3 as in any other version. The fact that you see a 404 error if you call that URL with a browser or anything not sending an XML-RPC call is correct as well. To be sure it's being called, look up in tomcat/logs/localhost-{today}.txt and look if lines like the following are being appended:

2007-03-14 09:15:39 StandardContext[/queuemetrics-1.3.3][5A5E655EAAE75E2A330D9CD4BF0FA7D3] Inizio classe it.loway.app.queuemetrics.xmlrpc.tpfServer
2007-03-14 09:15:40 StandardContext[/queuemetrics-1.3.3][5A5E655EAAE75E2A330D9CD4BF0FA7D3] Fine classe it.loway.app.queuemetrics.xmlrpc.tpfServer
2007-03-14 09:15:40 StandardContext[/queuemetrics-1.3.3]LowayTransactionController: [5A5E655EAAE75E2A330D9CD4BF0FA7D3] Tempo totale esecuzione verbo 'xmlrpc': 1725 ms

Anybody else experiencing problems with XML-RPC?


chaag

  • Newbie
  • *
  • Posts: 11
  • Karma: 2
    • View Profile
    • Email
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #2 on: March 14, 2007, 16:03:12 »
I tried connecting directly from the server that hosts queuemetrics
Python 2.3.4 (#1, Sep 26 2006, 17:23:01)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import xmlrpclib
>>> server = xmlrpclib.Server("http://127.0.0.1:8080/qm130/xmlrpc.dp")
>>> server.system.listMethods
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.3/xmlrpclib.py", line 1070, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for 127.0.0.1:8080/qm130/xmlrpc.dp: 404 /qm130/xmlrpc.dp>


Tailing the logs shows nothing, I'd guess I am simply not connecting, is there a way to force a connection using telnet or something?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #3 on: March 14, 2007, 16:16:50 »
I see you are using the extension .dp, that will surely give a 404 error  :)
I am checking to see if there is any problem with the XML-RPC interface in 1.3.3.

chaag

  • Newbie
  • *
  • Posts: 11
  • Karma: 2
    • View Profile
    • Email
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #4 on: March 14, 2007, 16:29:51 »
(doh!)
same error with .do, thanks for taking a look, I have an exec dashboard on another system that shows calls per day (and other stats), it would be nice if I could just pull each days data over via this interface.

thanks!

>>> server = xmlrpclib.Server("http://127.0.0.1:8080/qm130/xmlrpc.do")
>>> server.system.listMethods
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.3/xmlrpclib.py", line 1070, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for 127.0.0.1:8080/qm130/xmlrpc.do: 404 /qm130/xmlrpc.do>

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #5 on: March 14, 2007, 16:52:39 »
I am running this on the latest 1.3.3 using a standard Windows Python 2.4 install. I am no Python guru so if you know how to get the exact version numbers of components I'll be glad to help.

I do this:

>>> url = "http://10.10.3.100:8080/queuemetrics/xmlrpc.do"
>>> server = xmlrpclib.Server( url )
>>> res = server.QM.stats( "queue-dps", "robot", "robot","", "","2005-10-10.10:23:12", "2007-10-10.10:23:10","", ['KoDO.DiscCauses', 'CallDistrDO.AnsDistrPerDay' ] )
>>> res.keys()
['CallDistrDO.AnsDistrPerDay', 'result', 'KoDO.DiscCauses']

And get no errors - in fact the keys are correct results.

If I try running the method:

>>> server.system.listMethods

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in -toplevel-
    server.system.listMethods
  File "C:\Programmi\Python24\lib\xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "C:\Programmi\Python24\lib\xmlrpclib.py", line 1383, in __request
    verbose=self.__verbose
  File "C:\Programmi\Python24\lib\xmlrpclib.py", line 1147, in request
    return self._parse_response(h.getfile(), sock)
  File "C:\Programmi\Python24\lib\xmlrpclib.py", line 1286, in _parse_response
    return u.close()
  File "C:\Programmi\Python24\lib\xmlrpclib.py", line 744, in close
    raise Fault(**self._stack[0])
Fault: <Fault -1: 'The specified handler cannot be found'>

I get the error message - most likely it means QM does not support XML-RPC methods autodiscovery.

Are you sure that your URL http://127.0.0.1:8080/qm130 is the correct URL for QM 1.3.3? if you use your browser and enter the address http://127.0.0.1:8080/qm130/qm_start.do does this lead you to the Authentication page?

Please keep us posted.





chaag

  • Newbie
  • *
  • Posts: 11
  • Karma: 2
    • View Profile
    • Email
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #6 on: March 14, 2007, 17:07:20 »
Success! (and embarrassment)

In my lame understanding of Tomcat, I had somehow assumed /qm130/ was actually meaningful, rather than simply how the example instance had been set up. Works great when I use a valid URL.

Apologies for such a silly question.

Thanks for the help

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Does anyone have the XML RPC API working with 1.3.3?
« Reply #7 on: March 14, 2007, 17:13:59 »
You are welcome! we love those bugs that aren't! :)