Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generate wsdl file and webservice client based on wsdl file in maven

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!

like image 451
Runar Halse Avatar asked Oct 11 '22 01:10

Runar Halse


1 Answers

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.

like image 145
Sean Patrick Floyd Avatar answered Oct 29 '22 00:10

Sean Patrick Floyd