I am working on a project where I have a webservice module, and a webmodule. I want a client to be generated based on the wsdl file of the webservice, and I want the wsdl file to be generated when I build the webservice module.
I have found the maven plugins to do this(axis2-java2wsdl-maven-plugin and axis2-wsdl2code-maven-plugin), but the axis2-java2wsdl-maven-plugin keeps generating invalid xsd for the wsdl file(I think its invalid at least).
The webservice returns some enums from its methods, or returns objects that contain enums. When generating the wsdl file, I get a reference to "xs:Enum" which does not exist in the given namespace for two of the enum types. I have several, but only two of them gets this base="xs:Enum".
<xs:complexType name="LoginType">
<xs:complexContent>
<xs:extension base="xs:Enum">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
So when building the client module with the axis2-wsdl2code-maven-plugin, I get the following error:
error: src-resolve: type 'Enum@http://www.w3.org/2001/XMLSchema' not found.
I don't understand why it keeps generating invalid XSD!
This has been a known issue for a very long time. It's one of the (many) reasons I started using Apache CXF instead of Axis. It even has a similar Maven Plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With