#6 Fix for bug 891149

closed-fixed
None
5
2007-10-02
2004-09-15
No

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:

&lt;getFooResponse xmlns="http://example.com/v1">
&nbsp;&nbsp; &lt;getFooReturn>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;complexFoo>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;id>100&lt;/id>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;arrayFoo>one&lt;/arrayFoo>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;arrayFoo>two&lt;/arrayFoo>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/complexFoo>
&nbsp;&nbsp; &lt;/getFooReturn>
&lt;/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.

Discussion

  • Lexi Baugher

    Lexi Baugher - 2004-09-15

    Patch to soap::deserializer and a test case

     
  • Byrne Reese

    Byrne Reese - 2004-09-28
    • assigned_to: nobody --> byrnereese
    • status: open --> open-fixed
     
  • Byrne Reese

    Byrne Reese - 2004-09-28

    Logged In: YES
    user_id=28043

    Patch integrated. Thank you for the contribution.

     
  • Martin Kutter

    Martin Kutter - 2007-10-02
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks