基于maven中的wsdl文件生成wsdl文件和webservice客户端

Run*_*lse 5 wsdl maven-2 code-generation web-services

我正在开发一个项目,我有一个webservice模块和一个webmodule.我希望基于webservice的wsdl文件生成客户端,并且我希望在构建webservice模块时生成wsdl文件.

我找到了maven插件来做到这一点(axis2-java2wsdl-maven-plugin和axis2-wsdl2code-maven-plugin),但是axis2-java2wsdl-maven-plugin一直为wsdl文件生成无效的xsd(我认为它在最小).

webservice从其方法返回一些枚举,或返回包含枚举的对象.生成wsdl文件时,我得到对"xs:Enum"的引用,这两个枚举类型在给定的命名空间中不存在.我有几个,但只有两个得到这个base ="xs:Enum".

<xs:complexType name="LoginType">
    <xs:complexContent>
        <xs:extension base="xs:Enum">
            <xs:sequence/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>
Run Code Online (Sandbox Code Playgroud)

因此,当使用axis2-wsdl2code-maven-plugin构建客户端模块时,我收到以下错误:

error: src-resolve: type 'Enum@http://www.w3.org/2001/XMLSchema' not found.
Run Code Online (Sandbox Code Playgroud)

我不明白为什么它一直生成无效的XSD!

Sea*_*oyd 4

这长期以来一直是一个已知问题。这是我开始使用Apache CXF而不是 Axis 的(众多)原因之一。它甚至还有一个类似的 Maven Plugin