A scripting language like Perl poses further challenges to using the API because of the data type mappings. This section provides an example of setting up the initial connection using the API with the Perl language.
This example assumes the following settings in the InControl server interface:
The Perl code required to set up the initial connection to this server using the the API would be the following:
my $ws_url = "http://example.com:8080/InControl?wsdl"; my $ws_uri = 'www.example.com/incontrol'; my $xmlns = 'http://schemas.datacontract.org/2004/07/Clavister.InControl.API.WCF'; my $soap = SOAP::Lite -> uri( $ws_uri) -> on_action(sub{sprintf '%s/IRemoteServer/%s', @_}) -> proxy($ws_url); $soap->readable('true'); # setup the HTTP Basic Auth parameters BEGIN { sub SOAP::Transport::HTTP::Client::get_basic_credentials { return $username => $password; } }