What is the best way to represent in java a "choice" namespace tag? ie.
<xs:complexType name="MyType">
<xs:sequence>
<!-- common elements here -->
<xs:element type="xs:string" name="name" ... />
</xs:sequence>
<xs:choice>
<xs:element name="stringValue" type="xs:string"></xs:element>
<xs:element name="intValue" type="xs:int"></xs:element>
</xs:choice>
</xs:complexType>
How do I model this in Java? I was thinking about something like:
public class MyType
String name;
String stringValue;
int intValue;
...
but this is sure not the best way, or I am wrong? Plus, if I want to expose services with Axis2 which use that type, do I need to implement some custom message receiver?