2

I am trying to generate my java classes using jaxws. The problem is that my binding files are being ignored. I have two binding files in the bindingDirectory. Maybe someone could help ?

    <profiles>

    <profile>
        <id>Generate model (POJOS) from wsdl</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>

        <build>
            <!-- JAX-WS provides a tool called wsimport which takes the WSDL of a 
                web service and generates proxy classes or the WSDL's service and port definitions. 
                These can then be used to access the web service endpoint. -->
            <plugins>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jaxws-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>Id1</id>
                                <goals>
                                    <goal>wsimport</goal>
                                </goals>
                                <configuration>
                                <wsdlUrls>
                                    <wsdlUrl>http://intan.local:8080/toa/ws/airService?wsdl</wsdlUrl>
                                </wsdlUrls>
                                <target>2.1</target>
                            <xjcArgs>
                                <xjcArg>-XautoNameResolution</xjcArg>
                            </xjcArgs>
                            <verbose>true</verbose>
                            <extension>true</extension>
                            <bindingFiles>
                                <bindingFile>src/main/resources/schemas/2011b/xjb/global.xjb</bindingFile>
                                <bindingFile>src/main/resources/schemas/2011b/xjb/TPA_ExtensionsType.xjb</bindingFile>
                            </bindingFiles>
                            <keep>true</keep>
                                    <packageName>gr.intan.toa._2011b</packageName>
                                    <sourceDestDir>src/main/generated</sourceDestDir>
                                <extension>true</extension>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                    <dependency>
                            <groupId>javax.xml</groupId>
                                <artifactId>webservices-api</artifactId>
                                <version>1.4</version>
                            </dependency>
                            <dependency>
                                <groupId>com.sun.xml.bind</groupId>
                                <artifactId>jaxb-xjc</artifactId>
                                <version>2.1.12</version>
                            </dependency>
                            <dependency>
                                <groupId>com.sun.xml.ws</groupId>
                                <artifactId>jaxws-rt</artifactId>
                                <version>2.1.4</version>
                            </dependency>
                    </dependencies>
                        <configuration>
                            <target>2.1</target>
                            <xjcArgs>
                                <xjcArg>-XautoNameResolution</xjcArg>
                            </xjcArgs>
                            <bindingDirectory>src/main/resources/schemas/2011b/xjb</bindingDirectory>
                            <keep>true</keep>
                        </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

thanks in advance

giannisapi
  • 2,641
  • 3
  • 24
  • 31

1 Answers1

0

I think bindingDirectory works only when explicitly configuring the xjc plugin. You should try the bindingFile semantics:

<configuration>
 <wsdlOptions>
  <wsdlOption>
   <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
   <bindingFiles>
    <bindingFile>${basedir}/src/main/resources/wsdl/async_binding.xml</bindingFile>
   </bindingFiles>
  </wsdlOption>
 </wsdlOptions>
</configuration>

http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html

Gergely Szilagyi
  • 3,813
  • 1
  • 14
  • 12
  • hi, after your comment i edited my pom as you suggested. I now get an exception with no info at all even when using debug output in mavne. the exceptin comes from "Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing: wsimport " any more ideas please? as you can see I have edited the question as to what you told me. thanks again – giannisapi Jun 27 '12 at 07:38
  • are you using the latest versions of the plugins/dependencies? try running `mvn versions:display-plugin-updates` and `mvn versions:display-dependency-updates` and updating your versions accordingly. – Gergely Szilagyi Jun 27 '12 at 07:51
  • I will investigate a bit more and come back. I believe that the problem is in my bidings not being set up correctly. I will come back when I have solved this or have a good question. thanks for your help. – giannisapi Jun 27 '12 at 07:57