Actually, a list is a specialization of an array, not the other way
around. As James says, a list requires more information than an XSD
type array. An XSD type array has no sense of order or index. It is
simply a repeating element. There's no metadata included in each of
the repeating element to indicate indexing or ordering.

SOAPpy can easily maps things around because Python is a loosely typed
language. Java is strongly typed and therefore much more strict about
mapping types.

In any case, if you want to map the returned array to a Java
collection class, then you must write a custom deserializer that does
so. You also must define a client config file that tells Axis to use
your custom deserializer.

Anne

On 7/4/05, Scott Lamb <[EMAIL PROTECTED]> wrote:
> On 3 Jul 2005, at 19:09, James Black wrote:
> 
> 
> > Scott Lamb wrote:
> >
> >
> >> I still do not understand. Why can't I serialize a List with exactly
> >> the same XML representation as an array? And deserialize it back to a
> >> List? Why does the other side have to know anything about this?
> >>
> >>
> >
> >  A list has other attributes besides an array, as it has to know
> > something about order and relationships between items.
> >
> 
> This is nonsense. I don't know the intricacies of SOAP or Axis, but I
> know what arrays and lists are.
> 
> A list is an ordered collection of items.
> 
> An array is an indexed collection of items. Indexed implies ordered.
> Thus, an array is a specialization of list. (In Java, there is an
> ArrayList class. A list represented in memory by an array. It
> supports the exact same operations as LinkedList; the only difference
> is the complexity of some operations. I.e., get(int n) is O(1)
> instead of O(n).)
> 
> Their serialization is the same; you'd write an array in order of
> ascending indexes.
> 
> --
> Scott Lamb <http://www.slamb.org/>
> 
> 
>

Reply via email to