I'm using the following code to query the SOAP API in my traffic manager:
#!/usr/bin/perl -w
use SOAP::Lite;
# This is the url of the admin server
my $admin_server = 'https://admin:[email protected]:9090';
my $conn = SOAP::Lite
-> uri('http://soap.zeus.com/zxtm/1.0/VirtualServer/')
-> proxy("$admin_server/soap");
# Get a list of virtual servers
my $res = $conn->getVirtualServerNames();
my @names = @{$res->result};
# Establish which are enabled
$res = $conn->getEnabled( \@names );
my @enabled = @{$res->result};
# Print those which are enabled
for( my $i = 0; $i <= $#names; $i++ ) {
if( $enabled[$i] ) {
print "$names[$i]\n";
}
}
... but I'm now getting an error message:
use_prefix has been deprecated. if you wish to turn off or on
the use of a default namespace, then please use either ns(uri)
or default_ns(uri) at /usr/share/perl5/SOAP/Lite.pm line 858
What's up?
Solved! Go to Solution.
This problem has caught out a number of users who have been using the Feature Brief: Stingray's SOAP Control API for a long time.
The SOAP::Lite library has deprecated the use of 'uri' to specify the namespace for a SOAP request - see SOAP::Lite for Perl: uri and use_prefix deprecated in next release for more information. This change is slowly rolling out as users update their SOAP::Lite library instances.
In most cases, you can simply replace the call to 'uri' with a call to 'ns', as follows:
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/VirtualServer/')
-> proxy("$admin_server/soap");
This problem has caught out a number of users who have been using the Feature Brief: Stingray's SOAP Control API for a long time.
The SOAP::Lite library has deprecated the use of 'uri' to specify the namespace for a SOAP request - see SOAP::Lite for Perl: uri and use_prefix deprecated in next release for more information. This change is slowly rolling out as users update their SOAP::Lite library instances.
In most cases, you can simply replace the call to 'uri' with a call to 'ns', as follows:
my $conn = SOAP::Lite
-> ns('http://soap.zeus.com/zxtm/1.0/VirtualServer/')
-> proxy("$admin_server/soap");