How to compile sample API code written in Perl
Basic instructions for compiling the Citrix NetScaler API with the PERL scripting language.
Requirements
The following are required to compile Perl code which uses the Citrix NetScaler API.
- The SOAP::Lite Perl module, available at http://www.soaplite.com/.
- HTTP::Cookie - used for client authentication purposes, since SOAP::Lite does not support cookies on its own.
The following command should install all of the required modules: perl -MCPAN -c "install 'SOAP::Lite'"
Cookie Handling
As mentioned above, the SOAP::Lite perl module does not handle cookies. You can handle cookies in your perl code as follows
# Create cookie object. Server sends cookie for client authentication.
my $cookies = HTTP::Cookies->new(ignore_discard=> 1, hide_cookie2 => 1);
# create the soap object and pass the cookies object
my $soap = SOAP::Lite-> proxy("http://$<NS>/soap", cookie_jar=>$cookies);
HTTPS support
You also need to use the HTTPS protocol to send secure API requests to the Citrix NetSclaer. An additional package, 'Crypt-SSLeay' needs to be installed to use the HTTPS protocol in the API request.
usage : perl <scriptname>https:// <NS IP> <username> <password>
Add Comment