« Back to Administration XML Questions

Grab perfmon objects/counters using SOAP::Lite

Combination View Flat View Tree View
Threads [ Previous | Next ]
Trying to get a handle on what SOAP::Lite sends - I can do this with curl but was looking to use perl.
This works:
#!/usr/bin/perl -w
BEGIN { $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0 }
use strict;
use warnings;
use SOAP::Lite +trace => 'debug';
use Data:emoticonumper;
use MIME::Base64;
 
my $cucmip = "xxx.xxx.xxx.xxx";
my $axl_port = "8443";
my $user = "axluser";
my $password = "password";
my $axltoolkit = "AXLAPI.wsdl";
 
my $cm = new SOAP::Lite
encodingStyle => '',
uri => "$axltoolkit",
proxy => "https://$cucmip:$axl_port/axl/" ;
 
$cm = Login($cm,$user,$password);
 
#axl request
my $res = $cm->listUserByName(SOAP:emoticonata->name("firstname" => "%"),
SOAP:emoticonata->name("lastname" => "%"),
SOAP:emoticonata->name("searchLimit" => "")
);
unless ($res->fault) {
print Dumper($res->valueof('//listUserByNameResponse/return'));
} else {
print join ', ',
"FAULTCODE: " . $res->faultcode,
"FAULTSTRING: " . $res->faultstring;
}
 
################################################
 
sub Login {
$cm->transport->http_request->header (
'Authorization' => 'Basic ' . encode_base64("$user:$password", '')
);
 
return $cm;
}
################################################## 
Which sends this:
SOAPAction: "AXLAPI.wsdl#listUserByName"
 
 
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<listUserByName xmlns="AXLAPI.wsdl">
<firstname xsi:type="xsd:string">%</firstname>
<lastname xsi:type="xsd:string">%</lastname>
<searchLimit xsi:type="xsd:string" /></listUserByName>
</soap:Body></soap:Envelope>
 
And I get a good response- 
To get perfmon object/counters would I use:
proxy => "https://$cucmip:$axl_port/perfmonservice
 
Anyone have the correct syntax for this?
Thanks