gpt4 book ai didi

java - jaxws 导入。绑定(bind)文件被忽略

转载 作者:行者123 更新时间:2023-11-29 09:13:07 30 4
gpt4 key购买 nike

我正在尝试使用 jaxws 生成我的 java 类。问题是我的绑定(bind)文件被忽略了。我在 bindingDirectory 中有两个绑定(bind)文件。也许有人可以提供帮助?

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

提前致谢

最佳答案

我认为 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

关于java - jaxws 导入。绑定(bind)文件被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11221081/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com