axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flores, Raul" <raul.flo...@lmco.com>
Subject RE: Collections classes?
Date Tue, 05 Jul 2005 19:51:47 GMT
 
Scott,

Save this thread. Someday you might need a good laugh, and when you do,
read it again (if you can handle laughing at yourself).

Raul Flores


-----Original Message-----
From: Scott Lamb [mailto:slamb@slamb.org] 
Sent: Monday, July 04, 2005 12:23 PM
To: axis-user@ws.apache.org
Subject: Re: Collections classes?

On 4 Jul 2005, at 08:38, Anne Thomas Manes wrote:
> 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.

Okay, first of all, when I've been describing arrays, I'm talking about
arrays on the Java side. I've been treating the SOAP side as a black
box. I know that Axis is capable of producing a Java array, which has
the same requirements as a Java List. Thus, I don't need to know
_anything_ about SOAP or XSD to know that you are wrong. The ordering
information is there. To give a concrete example, when I do a google
search with their published WSDL, I get my results in order.  
I simply want that to be a with a List<ResultElement> rather than a
ResultElement[].

Secondly, of course the XSD does not describe ordering. It doesn't need
to. When you serialize something as a stream of bytes, you're always
putting them in order. It's called serialization for a reason.  
The order of the array/list/whatever is the order that the objects are
written in.

> 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.

If it can map it to a Java ResultElement[] in advance, why can't it map
it to a Java List<ResultElement> in advance? Strong typing is not the
problem.

> 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.

How would I write this custom deserializer? All the information I've
seen on the website - and the articles James Black linked to - seem to
be talking about registering new types: i.e., a "java.foo.Blah <->
Blah". I want to change how XSD x[] to map to Java List<x> rather than
Java x[], for all x.

Once I do that, I'll look into more sophisticated collections: Maps,
Sets. I don't know if that's possible, but I'd like to try.

Scott

--
Scott Lamb <http://www.slamb.org/>


Mime
View raw message