2012-06-27 110 views
2

我想用jaxws生成我的java類。問題是我的綁定文件被忽略。我在bindingDirectory中有兩個綁定文件。也許有人可以幫忙?jaxws導入。綁定文件被忽略

<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> 

在此先感謝

+0

你找到一個解決這個問題? –

回答

0

我覺得bindingDirectory只能在明確配置XJC插件。你應該嘗試的bindingFile語義:

<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

+0

嗨,你的評論後我編輯我的POM,如你所建議的。即使在mavne中使用調試輸出,我現在也會得到一個沒有任何信息的異常。 exceptin來自「引起:org.apache.maven.plugin.MojoExecutionException:執行錯誤:wsimport」請有更多想法嗎?正如你所看到的,我已經編輯了關於你告訴我的問題。再次感謝 – giannisapi

+0

您使用的是最新版本的插件/依賴關係嗎?嘗試運行'mvn版本:display-plugin-updates'和'mvn versions:display-dependency-updates'並相應地更新你的版本。 –

+0

我會再調查一下,然後回來。我認爲問題在於我的投標沒有正確設置。當我解決這個問題或有一個很好的問題時,我會回來。謝謝你的幫助。 – giannisapi