Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert WDSL to Java with Axistools-maven-plugin?

I configured the axistools-maven-plugin as follows:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <version>1.4</version>
    <configuration>
        <wsdlDirectory>/src/main/resources</wsdlDirectory>
        <wsdlFiles>
            <wsdlFile>adjustment.wsdl</wsdlFile>
        </wsdlFiles>
        <keep>true</keep>
        <allElements>true</allElements>
        <outputDirectory>/src/main/java</outputDirectory>
        <subPackageByFileName>true</subPackageByFileName>
        <useEmitter>true</useEmitter>
        <wsdlVersion>2</wsdlVersion>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

but my wsdl files are not being referred properly. Is the configuration correct?

I am getting the following info msg always

[INFO] Nothing to generate. All WSDL files are up to date.
like image 641
Achaius Avatar asked Oct 17 '11 12:10

Achaius


3 Answers

For me it was the directory parameter name. It's not <wsdlDirectory> but <sourceDirectory>. Anyway, here's my working config:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>axistools-maven-plugin</artifactId>
    <version>1.4</version>
    <configuration>
        <!--  A directory where the WSDL files reside: -->
        <sourceDirectory>${basedir}/src/main/resources/</sourceDirectory>
        <!-- The list of WSDL files: -->
        <wsdlFiles>
            <wsdlFile>services.wsdl</wsdlFile>
        </wsdlFiles>
        <allElements>true</allElements>
        <!-- Where you want the generated files: -->
        <outputDirectory>${basedir}/src/main/java</outputDirectory>
        <subPackageByFileName>true</subPackageByFileName>
        <useEmitter>false</useEmitter>
        <verbose>true</verbose>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>
like image 198
Cleankod Avatar answered Sep 22 '22 16:09

Cleankod


Got almost the same (info) message when i had a typo in wsdlFile! The actual message was: "Skipping up to date wsdl"

e.g.

<sourceDirectory>src\main\resources\wsdl\release\x.y\</sourceDirectory>
<wsdlFiles>
       <wsdlFile>ABCWebservicex.y.wsdl</wsdlFile>  <!-- typo here -->
</wsdlFiles>

And the file present was: ABCWebservice_x.y.wsdl

like image 28
rwijngaa Avatar answered Sep 18 '22 16:09

rwijngaa


Skipping the leading slash in /src/main/java and /src/main/resources will probably help.

Edit: I've taken a closer look at my working configuration. I don't know how you came to this:

<wsdlDirectory>src/main/resources</wsdlDirectory>

Should probably be:

<sourceDirectory>src/main/resources</sourceDirectory>
like image 34
MaDa Avatar answered Sep 19 '22 16:09

MaDa