axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Powell" <>
Subject RE: Philosophical question about WSDL and web service frameworks
Date Wed, 16 Jan 2002 22:09:52 GMT
Similar to the suggestion below, you could have an int property that
indicates which choice is selected.  On setXXX() just change the index
to the value for that option, thus enforcing "at most one selected".


-----Original Message-----
From: James Yegerlehner [] 
Sent: Wednesday, January 16, 2002 4:54 PM
Subject: Re: Philosophical question about WSDL and web service

Rich and Russel-

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

> If you have some suggestions as to how we'd map these to Java, we'd
> 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
the same could be done with "xsd:choice" with minor impact. A trivial
methods) interface, called "ChoiceCompositor" could be defined, which,
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",
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
of the presence of the members.

I'm not familiar with the Axis internals, but I'd expect this solution
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",
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,
assign it. Skip the other members.

Hope that makes sense.


James Yegerlehner
Omniopera: XML Schema and WSDL Authoring Software

View raw message