How to convert WDSL to Java with Axistools-maven-plugin?
Asked Answered
Y

4

6

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.
Yellowgreen answered 17/10, 2011 at 12:8 Comment(2)
Unfortunatelly, the axistools-maven-plugin issues an [INFO] Skipping up to date wsdl: ... for files not found instead of alerting about incorrect paths. Check your paths as suggested in the answers, and correct the wsdlDirectory to sourceDirectory, as per MaDa post.Bindweed
For future reference, this plugin supports WSDLs RPC/encodedBindweed
B
8

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>
Bellabelladonna answered 18/9, 2015 at 14:4 Comment(1)
did not generate java code.. created empty generated-sources\annotations folder, not even generated-sources/wsdl2javaLoquacious
Y
6

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

Yates answered 12/3, 2013 at 14:13 Comment(1)
In my case I had .WSDL correctly named but apparently it does not like caps.Return
W
2

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>
Whipstock answered 17/10, 2011 at 14:2 Comment(2)
After removing that leading slashes also getting the same info msg.Yellowgreen
+1 I had to explicitly spell the sourceDirectory to ${basedir}/src/main/wsdl even though the plugin help (mvn help:describe -Dplugin=org.codehaus.mojo:axistools-maven-plugin -Ddetail=true) indicate that this is the default value!Bindweed
S
1

If you are using multiple wsdls under same wsdlfiles tag then you may encounter skipping info like below:

<wsdlFiles>
  <wsdlFile><file1>.wsdl</wsdlFile>
  <wsdlFile><file2>.wsdl</wsdlFile>                                 
</wsdlFiles>

In this case, either use single WSDL under wsdlfiles tag or use wsdloptions

<wsdlOptions>
  <wsdlOption>
    <wsdl>src/main/resources/wsdl/<file>.wsdl</wsdl>                         
    <wsdlLocation>classpath:wsdl<file1>.wsdl</wsdlLocation>
  </wsdlOption>
</wsdlOptions>

Do Maven Clean > Maven Update project > Maven Generated resources. DONE !

Sweltering answered 8/8, 2019 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.