On Jan 2, 2008, at 6:16 PM, Benson Margulies wrote:
On Wed, 2008-01-02 at 18:02 -0800, Dain Sundstrom wrote:
On Jan 2, 2008, at 3:44 PM, Benson Margulies wrote:
Here's the question. Given an XML message, how do you unmarshal it
if it
lacks an xsi:type? If you have a list of root elements, then you
know
their types.
If you don't have a list of root elements, what QNames do you
associate
with the types? Do you assume that, if a class has schema type QName
{aaaa}b that it also likes to be a root element names {aaaa}b?
Yes
This could only work at a safe distance from an actual web service.
When a service uses Aegis to write things, it supplies element names
from the parts. If you imagine a 'xsd2aegis' command, it would need
some
way to annotate that {bloop}return is used as an element for
{bleep}sometype. Maybe this is a red herring, and this is a case in
which the reader knows what it expects. I suppose that making the read
side use the element QName as a type QName is better than just
throwing
an exception in the absence of xsi:type or orders from Jupiter.
In Aegis I normally only configure the exceptions to a rule, so I'd
say the rule is the element name is the same as the type name. If
not, we configure the element name or mark a type as not a root
element. From the code perspective, element and type would be
separate qnames in the class, so it only effects what a user has to
enter.
-dain