diff options
author | Thorsten Schöning <tschoening@am-soft.de> | 2012-11-23 00:35:19 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-11-23 00:35:19 +0100 |
commit | 77b21ad273f6da6a3c6b221da3bc867b3962ca39 (patch) | |
tree | 71e87a22b80458362acbec661fe9ff98b26cf4cd | |
parent | 4c3e00573133dfc53d07805629af19599aaef7df (diff) | |
download | bugzilla-77b21ad273f6da6a3c6b221da3bc867b3962ca39.tar.gz bugzilla-77b21ad273f6da6a3c6b221da3bc867b3962ca39.tar.xz |
Bug 385283: bz_webservice_demo.pl --product-name fails (Product.get_product no longer exists)
Part 2: correctly display components, milestones and versions
r/a=LpSolit
-rwxr-xr-x | contrib/bz_webservice_demo.pl | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl index 32b9e27a1..3b87cf5b5 100755 --- a/contrib/bz_webservice_demo.pl +++ b/contrib/bz_webservice_demo.pl @@ -301,16 +301,24 @@ The call will return a C<Bugzilla::Product> object. if ($product_name) { $soapresult = $proxy->call('Product.get', {'names' => [$product_name]}); _die_on_fault($soapresult); - $result = $soapresult->result; - - if (ref($result) eq 'HASH') { - $result = $result->{'products'}->[0]; - foreach (keys(%$result)) { - print "$_: $result->{$_}\n"; + $result = $soapresult->result()->{'products'}->[0]; + + # Iterate all entries, the values may be scalars or array refs with hash refs. + foreach my $key (sort(keys %$result)) { + my $value = $result->{$key}; + + if (ref($value)) { + my $counter = 0; + foreach my $hash (@$value) { + while (my ($innerKey, $innerValue) = each %$hash) { + print "$key.$counter.$innerKey: $innerValue\n"; + } + ++$counter; } - } - else { - print "$result\n"; + } + else { + print "$key: $value\n" + } } } |