When I have annotaded java class like
@javax.xml.bind.annotation.XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class UserdataType {
String username;
String street;
String address;
it will be generated to
<xs:complexType name="userdataType">
<xs:sequence>
<xs:element name="username" type="xs:string" minOccurs="0"/>
<xs:element name="street" type="xs:string" minOccurs="0"/>
<xs:element name="address" type="xs:string" minOccurs="0"/>
So, by default JAX-WS always generates 'sequences' in XSD files.
This forces the clients to take care of the exact order the elements, which is not helpful in some cases.
Is there a way to generate something different then sequences?
Add an
XmlType
annotation with an emptypropOrder
, like this:It will then generate an
xs:all
(which is unordered) instead of a sequence.