首页 > 解决方案 > CXF 2.x 代码生成不生成引用类

问题描述

我正在尝试使用 Eclipse 的 Web 服务 > 生成客户端功能(右键单击 wsdl 时)从 wsdl 生成 java 客户端。

它确实生成了很多类,但是缺少一些类!!!

我看到至少一种类型它没有处理

<s:complexType name="Participant">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="ParticipantId" type="s:int" />
          <s:element minOccurs="0" maxOccurs="1" name="NameOrNumber" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EmailAddress" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="ParticipantCallType" type="tns:ParticipantType" />
        </s:sequence>
      </s:complexType>
      <s:simpleType name="ParticipantType">
        <s:restriction base="s:string">
          <s:enumeration value="TMS" />
          <s:enumeration value="IP Video &lt;-" />
          <s:enumeration value="IP Tel &lt;-" />
          <s:enumeration value="ISDN Video &lt;-" />
          <s:enumeration value="Telephone &lt;-" />
          <s:enumeration value="IP Video -&gt;" />
          <s:enumeration value="IP Tel -&gt;" />
          <s:enumeration value="ISDN Video -&gt;" />
          <s:enumeration value="Telephone -&gt;" />
          <s:enumeration value="Directory" />
          <s:enumeration value="User" />
          <s:enumeration value="SIP &lt;-" />
          <s:enumeration value="SIP -&gt;" />
          <s:enumeration value="3G &lt;-" />
          <s:enumeration value="3G -&gt;" />
          <s:enumeration value="TMS Master Participant" />
          <s:enumeration value="SIP Tel &lt;-" />
          <s:enumeration value="SIP Tel -&gt;" />
        </s:restriction>
      </s:simpleType>

因此生成了 Participant 类,但 ParticipantType 不是,并且 ParticipantCallType 字段以字符串而不是枚举的形式出现。

我在向导中尝试了一些选项,但没有一个解决了这个问题(生成了参考类 ParticipantCallType) 在此处输入图像描述

我应该注意到我使用 CXF 3.4.3 作为我的运行时

标签: cxf-codegen-plugin

解决方案


推荐阅读