When the response contains a struct with a nested
document/literal array. SOAP::Deserializer flattens the
array into a single scalar whose value is the last
element of the array (because it maps all the child
nodes into a hash, keyed off the name of the child nodes).
<a
href="http://sourceforge.net/tracker/index.php?func=detail&aid=891149&group_id=66000&atid=513017">Bug
891149</a> has one example.
This patch modifies the struct element parsing so that
repeated child elements are turned into an array. The
result is that this document:
<getFooResponse xmlns="http://example.com/v1">
<getFooReturn>
<complexFoo>
<id>100</id>
<arrayFoo>one</arrayFoo>
<arrayFoo>two</arrayFoo>
</complexFoo>
</getFooReturn>
</getFooResponse>
would now be parsed to a structure like this:
$VAR1 = {
'complexFoo' => {
'arrayFoo' => [
'one',
'two'
],
'id' => 100
}
};
(The existing code creates the following structure)
$VAR1 = {
'complexFoo' => {
'arrayFoo' =>'one',
'id' => 100
}
};
The patch is against the latest CVS sources.
Patch to soap::deserializer and a test case
Logged In: YES
user_id=28043
Patch integrated. Thank you for the contribution.