mcphargus / python-glpi

A python interface to the GLPI webservices plugin
GNU General Public License v2.0
15 stars 9 forks source link

New branch with GLPIClient.py switched from REST to XMLRPC #6

Open fsoyer opened 11 years ago

fsoyer commented 11 years ago

Hi mcphargus, so as I couldn't resolve the problem of "not authenticated" messages (same as issue #2), and having a working example of a PHP script using xmlrpclib, I decided to spent some time to try switching your class to XMLRPC. Finally, here it is : and it works now on my installation ;) I've worked on your code, not fargue59's one, because his was not in git repo. I'm not sure about what his "curried" code provides; maybe it will be interesting to merge it at one time. I've left your code commented for now. You'll can see that the new code seems lighter : no more need of urllib, nor json (but I let you confirm that last point). I've also added a logout function, and updated some others. Note that ddurieux and remi, most active developers on GLPI-PROJECT and webservice, admit that the XMLRPC server is more stable than REST one. Remi for example is using exclusively XMLRPC. I've created a branch, I pull it to you if you want to examine the code. Thanks for attention.

mcphargus commented 11 years ago

I've had a hard time passing php arrays from xmlrpclib. Was I not trying hard enough? Were you able to overcome this? Or did I totally miss something?

I started working on an xmlrpc client a while and skeletonized a class for it. But i must not have pushed it in.

On May 31, 2013 8:07 AM, "fgth" notifications@github.com wrote:

Hi mcphargus, so as I couldn't resolve the problem of "not authenticated" messages (same as issue #2), and having a working example of a PHP script using xmlrpclib, I decided to spent some time to try switching your class to XMLRPC. Finally, here it is : and it works now on my installation ;) I've worked on your code, not fargue59's one, because his was not in git repo. I'm not sure about what his "curried" code provides; maybe it will be interesting to merge it at one time. I've left your code commented for now. You'll can see that the new code seems lighter : no more need of urllib, nor json (but I let you confirm that last point). I've also added a logout function, and updated some others. Note that ddurieux and remi, most active developers on GLPI-PROJECT and webservice, admit that the XMLRPC server is more stable than REST one. Remi for example is using exclusively XMLRPC. I've created a branch, I pull it to you if you want to examine the code. Thanks for attention.


You can merge this Pull Request by running

git pull https://github.com/fgth/python-glpi XMLRPC

Or view, comment on, or merge it at:

https://github.com/mcphargus/python-glpi/pull/6

Commit Summary New branch with GLPIClient.py switched from REST to XMLRPC File Changes M pyglpi/GLPI/GLPIClient.py (784) A pyglpi/examples/glpi_connect.py (18) Patch Links: https://github.com/mcphargus/python-glpi/pull/6.patch https://github.com/mcphargus/python-glpi/pull/6.diff

rodrigorega commented 11 years ago

XMLRPC is working for me, thanks.