summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-12-05 17:35:10 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-12-05 17:35:10 +0100
commitd6c87445aa63af62cf5b93d546807afc2429e7fd (patch)
tree762949a7f574ed7883f0bcfddbf560e15a965037 /contrib
parentf3bcc1d514bb75557a2da8404b468e4e34e76d95 (diff)
parentd8b74774531bf854695f6b1497a405bc78b54559 (diff)
downloadbugzilla-d6c87445aa63af62cf5b93d546807afc2429e7fd.tar.gz
bugzilla-d6c87445aa63af62cf5b93d546807afc2429e7fd.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/bz_webservice_demo.pl30
1 files changed, 19 insertions, 11 deletions
diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl
index 104151d85..72ec58a88 100755
--- a/contrib/bz_webservice_demo.pl
+++ b/contrib/bz_webservice_demo.pl
@@ -287,24 +287,32 @@ if ($bug_id) {
=head2 Retrieving Product Information
-Call C<Product.get_product> with the name of the product you want to know more
-of.
+Call C<Product.get> with the name of the product you want to know more of.
The call will return a C<Bugzilla::Product> object.
=cut
if ($product_name) {
- $soapresult = $proxy->call('Product.get_product', $product_name);
+ $soapresult = $proxy->call('Product.get', {'names' => [$product_name]});
_die_on_fault($soapresult);
- $result = $soapresult->result;
-
- if (ref($result) eq 'HASH') {
- 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"
+ }
}
}