--- Lite.pm-orig Tue Apr 6 14:15:58 2004 +++ Lite.pm Tue Apr 6 14:28:09 2004 @@ -1939,14 +1939,14 @@ # multidimensional if ($multisize =~ /,/) { @$res = splitarray( [@dimensions], - [map { scalar(($self->decode_object($_))[1]) } @{$children || []}] + [map { scalar(($self->decode_object($_))[1]) } @{$self->first_multirefs($children) || []}] ); # normal } else { - @$res = map { scalar(($self->decode_object($_))[1]) } @{$children || []}; + @$res = map { scalar(($self->decode_object($_))[1]) } @{$self->first_multirefs($children) || []}; } # sparse (position) if (ref $children && exists SOAP::Utils::o_lattr($children->[0])->{"{$SOAP::Constants::NS_ENC}position"}) { @@ -1976,9 +1976,9 } elsif ($name =~ /^\{$SOAP::Constants::NS_ENC\}Struct$/ || !$schemaclass->can($method) && (ref $children || defined $class && $value =~ /^\s*$/)) { my $res = {}; $self->hrefs->{$id} = $res if defined $id; - %$res = map {$self->decode_object($_)} @{$children || []}; + %$res = map {$self->decode_object($_)} @{$self->first_multirefs($children) || []}; return defined $class && $class ne 'SOAPStruct' ? bless($res => $class) : $res; } else { my $res; @@ -1992,8 +1992,20 @@ } $self->hrefs->{$id} = $res if defined $id; return $res; } } + + sub first_multirefs { + my $self = shift; + my $children = shift; + return $children unless $#{$children}>0; + + my $new_children = []; + for my $child (@{$children}) { + (($child->[0]=~/multiRef$/) and unshift(@{$new_children}, $child)) or push(@{$new_children}, $child); + } + return $new_children; + } sub splitarray { my @sizes = @{+shift};