I'm trying to make a ws and I have small problem with classes generated by cxf.
Whenever I try to make a list, it is generated as a field of static inner class(wrapper).
for example
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="customerId" type="xs:int"/>
<xs:element name="orders">
<xs:complexType>
<xs:sequence>
<xs:element name="order" type="tns:order" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="order">
<xs:sequence>
<xs:element name="id" type="xs:long" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>
would generate
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "customer", propOrder = {
"customerId",
"orders"
})
public class Customer {
protected int customerId;
@XmlElement(required = true)
protected Customer.Orders orders;
...
public static class Orders {
@XmlElement(required = true)
protected List<Order> order;
...
and what I would like to get is
public class Customer {
protected int customerId;
protected List<Order> orders;
...
the xml for this example type should look like:
<customer>
...
<orders>
<order>
<id></id>
<name></name>
</order>
<order>
<id></id>
<name></name>
</order>
...
</orders>
</customer>
from what I understand, @XmlRootElement could be used when doing java2wsdl, but is there some way to generate this type of class from wsdl?
Currently calling customer.getOrders().getOrder() would return a list of orders which is a little counterintuitive