print $som->result, "\n";
QuoteHASH(0x227ce0c)
1
2
3
while (my ($key, $value) = each %{$som->result}) {
print "key: ", $key, " - Value: ", $value, "\n";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use SOAP::Lite +trace;
my $soap = SOAP::Lite->new( proxy => 'http://192.168.0.214/stockquote1.php');
$soap->on_action( sub { "urn:HelloWorld#sayHello" });
$soap->autotype(0)->readable(1);
my $som = $soap->call(
'CheckForSoftwareUpdates',
SOAP::Data->name('InstalledSoftware')->value(
\SOAP::Data->value([
SOAP::Data->name('SoftwareName')->value('SampleSoftware1'),
SOAP::Data->name('Version')->value('1.2.3'),
SOAP::Data->name('OperatingSystem')->value('Windows_XP'),
])
)
);
if ($som->fault)
{
die $som->fault->{ faultstring };
}
print $som->result, "\n";
1 2 3
use Data::Dumper; my $soap_result = $som->result; print Dumper($soap_result);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
$VAR1 = [ 'soapenv:Envelope', { 'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/' }, [ [ 'soapenv:Body', {}, [ [ 'ns2:CheckForSoftwareUpdatesResponse', { 'xmlns' => 'http://www.w3.org/2000/09/xmldsig#' }, [ [ 'ns2:InstalledSoftware', {}, [ [ 'ns2:SoftwareName', {}, 'SampleSoftware1', undef, 'SampleSoftware1', '{http://192.168.0.214/api/1.1}InstalledSoftware', {} ], [ 'ns2:File', {}, [ [ 'ns2:UpdateURL', {}, 'https://192.168.0.214/downloads/testfile.zip', undef, 'https://192.168.0.214/downloads/testfile.zip', '{http://192.168.0.214/api/1.1}UpdateURL', {}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $data = [ 'soapenv:Envelope', { 'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/' }, [ [ 'soapenv:Body', {}, [ [ 'ns2:CheckForSoftwareUpdatesResponse', { 'xmlns' => 'http://www.w3.org/2000/09/xmldsig#' }, [ [ 'ns2:InstalledSoftware', {}, [ [ 'ns2:SoftwareName', {}, 'SampleSoftware1', undef, 'SampleSoftware1', '{http://192.168.0.214/api/1.1}InstalledSoftware', {} ], [ 'ns2:File', {}, [ [ 'ns2:UpdateURL', {}, 'https://192.168.0.214/downloads/testfile.zip', undef, 'https://192.168.0.214/downloads/testfile.zip', '{http://192.168.0.214/api/1.1}UpdateURL', {} ] ] ] ] ] ] ] ] ] ] ]; my $wanted = $data->[2]->[0]->[2]->[0]->[2]->[0]->[2]->[1]->[2]->[0]->[2]; print Dumper($wanted);