Subject: | Warning: requested type 'b' (98) did not match wire type 's' (115) |
Date: | Fri, 16 Sep 2016 15:12:51 -0400 |
To: | bug-Net-DBus [...] rt.cpan.org |
From: | John Simpson <john_simpson [...] swajime.com> |
I'm getting the following warning: "requested type 'b' (98) did not
match wire type 's' (115)"
I've traced through the execution of the code, adding these debug lines:
Debug statements added to encode():
print "1: interface: $interface; type: $type; name: $name; direction:
$direction; types: @types\n";
and
print "2: type: $type; direction: $direction; types: @types\n";
after each @types assignment.
Debug statements added to decode():
print "3. interface: $interface; type: $type; name: $name; direction:
$direction; types: @types\n";
and
print "4. interface: $interface; type: $type; name: $name; direction:
$direction; types: @types\n";
after each @types assignment.
I get the following output during execution:
$ myprog.pl
1: interface: com.swajime.mbda_get.iou_config; type: methods; name:
ac_tail; direction: params; types:
4. interface: com.swajime.mbda_get.iou_config; type: methods; name:
ac_tail; direction: returns; types: string
ac_tail = SW0012
$ myprog.pl
1: interface: com.swajime.mbda_get.iou_config; type: methods; name:
ac_tail; direction: params; types:
4. interface: com.swajime.mbda_set.iou_config; type: methods; name:
ac_tail; direction: returns; types: bool
requested type 'b' (98) did not match wire type 's' (115) at
/usr/lib/perl5/Net/DBus/Binding/Iterator.pm line 239.
ac_tail = SW0012
It appears that the correct interface property is available during the
call to Introspector::encode(), but is not available during the call
to Introspector::decode(), obtained by the following line (the same in
both functions):
my $interface = $message->get_interface;
Because undef is returned when called from decode() the code goes on
to choose the first listed interface (random because it's a hash) and
returns the type for the given function of that interface.
Because I have the same function name on two different interfaces with
different return types, I am getting a 50% failure rate, depending on
which interface is listed first in the hash.
I would offer a patch, but I do not see how to correct the problem.
Thanks,
John