axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Yegerlehner" <>
Subject Re: Philosophical question about WSDL and web service frameworks
Date Wed, 16 Jan 2002 21:53:57 GMT
Rich and Russel-

Regarding the xsd:choice compositor and its mapping to java: Russel said:

> If you have some suggestions as to how we'd map these to Java, we'd like
> hear them.

OK here's an idea. It seems pretty obvious, so maybe you'll have better

Since Axis already maps "xsd:sequence" and xsd:all" compositors to a bean,
the same could be done with "xsd:choice" with minor impact. A trivial (no
methods) interface, called "ChoiceCompositor" could be defined, which, when
implemented by a bean, implies the choice semantics. That is, it implies
that at most one of the bean's properties can be non-null.

Optionally: the internal storage of each bean property could be "final", and
in the set function for the property, if any of the other properties is
non-null, an exception is thrown. This will enforce the mutual exclusivity
of the presence of the members.

I'm not familiar with the Axis internals, but I'd expect this solution would
impact four pieces:

1. WSDL2Java: "implements ChoiceCompositor" must be part of the bean
declaration when it is emitted.

2. Java2WSDL: detect that the bean implements the "ChoiceCompositor", and
emit "choice" as against "sequence" or "all"

3. Bean serializer: detect that the ChoiceCompositor interface is
implemented, and serialize only the non-null member.

4. Bean deserializer: ascertain which member of the "choice" is present, and
assign it. Skip the other members.

Hope that makes sense.


James Yegerlehner
Omniopera: XML Schema and WSDL Authoring Software

View raw message