Recently I just started to use the Citrix Netscalers again ( Load Balancers ). Being the person that I am, I wanted a way to grab the information using the SOAP API.
Now Citrix has a ton of documentation for Perl/C/C# and Java ( None for Python ). SOAP client support has not been the best for Python, in my opinion.
I know you have soappy/ZSI, which I have had issues with consuming Broken WSDL files ( Having to fix the Broken WSDL file manually, SUCKS!).
Just 2 weeks ago, I encounterd SUDS. This module is by far, the best SOAP client for Python.
There documentation is simple and straight to the point, with a bunch of nice samples to get you on your way.
Install SUDS before proceeding further. You can get suds from here. https://fedorahosted.org/suds/
Connection to my netscaler was as simple as this…
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
on linux2Type "help", "copyright", "credits" or "license" for more information.
>>> from suds.client import Client
>>> url = "http://nsip/api/NSConfig.wsdl"
>>> from suds.xsd.doctor import *
>>> imp = Import('http://schemas.xmlsoap.org/soap/encoding/')
>>> imp.filter.add("urn:NSConfig")
>>> d = ImportDoctor(imp)
>>> client = Client(url, doctor=d, location="http://nsip/soap/")
>>> client.service.login(username="login", password="pass")(simpleResult){ rc = 0 message = "Done" }
>>>
Continue reading “How to get information from the Netscaler using Python and Suds.” »