#51 Suppress type for array when autotyping off

closed-fixed
Martin Kutter
None
7
2007-10-08
2004-10-11
Lexi Baugher
No

When the serializer's autotyping is disabled, this
patch suppresses type generation for arrays and hashes
(the existing code already suppresses type generation
for scalars). This produces much more correct XML
because the tags have zero type information instead of
incorrect type information. (The incorrect type
information is typically something like 'ur-type[2]' or
'SOAPStruct'; that's because when autotyping is
disabled, the serializer doesn't try to construct a
correct type but then puts the 'default' type in the
tag. The default type has no particular meaning, so the
resulting XML can't be parsed by many servers.)

Here is an example of the difference for serializing
arrays when autotyping is off:

Suppose you have this array:
my @arr = [ 5, 6 ];

The existing code would produce this serialization:
<foo SOAP-ENC:arrayType="xsd:anyType[2]">
<item>5</item>
<item>6</item>
</foo>

The patch produces this serialization:
<foo>5</foo>
<foo>6</foo>

Discussion

  • Lexi Baugher
    Lexi Baugher
    2004-10-11

    patch to SOAP/Lite.pm and t/01-core.t

     
  • Martin Kutter
    Martin Kutter
    2007-10-04

    • priority: 5 --> 7
    • assigned_to: nobody --> kutterma
     
  • Martin Kutter
    Martin Kutter
    2007-10-04

    Logged In: YES
    user_id=884175
    Originator: NO

    The patch is unfortunetly out of date now. I'll try to fix this, anyway.

     
  • Martin Kutter
    Martin Kutter
    2007-10-08

    Logged In: YES
    user_id=884175
    Originator: NO

    Fixed in 1.53 in CVS. Will be in next revision.

     
  • Martin Kutter
    Martin Kutter
    2007-10-08

    • status: open --> closed-fixed