xsd 中的元素类型指的是它自己的 Complex 类型

Element type in xsd is referring its own Complex type

我有 xsd 这样的 -

   <xs:complexType name="ChoiceListItem">
    <xs:sequence>
     <xs:element name="childChoices" maxOccurs="unbounded" minOccurs="0" nillable="true" type="tns:ChoiceListItem"/>
     <xs:element name="name" nillable="true" type="xsd:string"/>
     <xs:element name="stringValue" nillable="true" type="xsd:string"/>
     <xs:element name="integerValue" nillable="true" type="xsd:int"/>
    </xs:sequence>
   </xs:complexType> 

这里可以看到我的childChoices类型是ChoiceListItem,它被定义在下。这是我的 Java class -

@XmlAccessorType(XmlAccessType.FIELD)  
@XmlType(name = "ChoiceListItem", propOrder = {
    "childChoices",
    "name",
    "stringValue",
    "integerValue"
})  
public class ChoiceListItem {

    @XmlElement(nillable = true)
    protected List<ChoiceListItem> childChoices;
    @XmlElement(required = true, nillable = true)
    protected String name;
    @XmlElement(required = true, nillable = true)
    protected String stringValue;
    @XmlElement(required = true, type = Integer.class, nillable = true)
    protected Integer integerValue;

当我在 SOAPUI 中 运行 它不显示 childChoices 值但显示其他三个项目。这是我的输出响应 -

  <ns3:getChoiceListItemsResponse xmlns:ns3="http://getservice.service">
     <getChoiceListItemsReturn>
        <items>
           <ChoiceListItem>
              <name>AD SERVICE</name>
              <stringValue>AD SERVICE</stringValue>
              <integerValue xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
           </ChoiceListItem>   

我想 xsd 没有正确定义..有人可以帮我定义正确的 xsd 其中序列元素类型指的是相同的复杂类型吗?

我已经通过更改 xsd

解决了这个问题
<xs:complexType name="ChoiceListItem">
    <xs:sequence>
     <xs:element name="childChoices" nillable="true" type="tns:ChoiceListItemArray"/>
     <xs:element name="name" nillable="true" type="xsd:string"/>
     <xs:element name="stringValue" nillable="true" type="xsd:string"/>
     <xs:element name="integerValue" nillable="true" type="xsd:int"/>
    </xs:sequence>
   </xs:complexType>
   <xs:complexType name="ChoiceListItemArray">
    <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="0" name="ChoiceListItem" nillable="true" type="tns:ChoiceListItem"/>
    </xs:sequence>
   </xs:complexType>