SOAP::Deserializer::decode_value() deserializes arrays/vectors incorrectly.
Around SOAP/Lite.pm line 2163 (version 0.69), the child elements are decoded. The first child with that element name is stored as a scalar, which is stuffed into a new arrayref if additional children with that element name are later encountered.
However, the logic for determining when to convert the scalar into an arrayref is faulty. If the scalar happens to already be an arrayref (that resulted from decoding an apachesoap:Vector, for example), the
elsif (ref $prev ne "ARRAY")
clause is never used, causing the following children to be incorrectly appended to the existing arrayref.
The solution is to keep track of how many children there are, instead of relying on the type of the child. See the attached patch.
Log in to post a comment.