Subject: | ML::MyXML + SOAP::Amazon::S3 bug |
SOAP::Amazon::S3 not working cause of incompatible implementations of
simple_to_xml
http://search.cpan.org/src/KARJALA/SOAP-Amazon-S3-0.023/lib/SOAP/Amazon/
S3.pm
In SOAP::Amazon::S3 you can see:
Show quoted text
> use XML::MyXML 0.052 qw(tidy_xml simple_to_xml xml_to_object);
Show quoted text> push @params, ( 'AWSAccessKeyId' => $self->{'access_key_id'} );
> push @params, ( 'Timestamp' => $timestamp );
> push @params, ( 'Signature' => $signature );
Show quoted text> my $xml_body = simple_to_xml(\@params);
i.e. it is array with 3 elements
0.052 implementation of XML::MyXML works ok
Show quoted text> sub simple_to_xml {
> my $arref = shift;
> if ($arref eq 'XML::MyXML') { $arref = shift; }
>
> my $xml = '';
>
> while (@$arref) {
> my $key = shift @$arref;
lastest version can't work with 3 element arrays:
Show quoted text> sub simple_to_xml {
> my $arref = shift;
> my $flags = shift || {};
Show quoted text> my $xml = '';
> my ($key, $value, @residue) = (ref $arref eq 'HASH') ? %$arref :
@$arref;
Show quoted text> Encode::_utf8_off($key);
> if (@residue) { confess "Error: the provided simple ref contains
more than 1 top element"; }
Show quoted text> my ($tag) = $key =~ /^(\S+)/g;
> confess "Error: Strange key: $key" if ! defined $tag;
@residue will always contain rest of array