Marshalling with XSD choice field in class
问题 I use a Java class to generate the WSDL schema dynamically. I have this as one of my fields: @XmlElements({ @XmlElement(name = "A", type = String.class), @XmlElement(name = "B", type = Integer.class), @XmlElement(name = "C", type = String.class), @XmlElement(name = "D", type = String.class) }) protected Object aOrBOrCOrD; During marshalling, when the single choice property aOrBOrCOrD is set, which tag name(A, B, C or D) would be set in the XML? Since there's only one field which would contain