首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >maven wsdl2code生成不正确的java存根文件

maven wsdl2code生成不正确的java存根文件
EN

Stack Overflow用户
提问于 2017-07-10 23:59:56
回答 1查看 375关注 0票数 0

我使用的是Maven,它生成了一个不正确的java存根文件,因为它没有在java存根文件的适当行上生成xmlns:t=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\“。我是个新手,但下面是我正在使用的代码片段。想知道adb和xmlbeans是否是一个可能的问题?

代码语言:javascript
复制
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.6.2</version> <!-- do not want to change since rebuilding existing webapp -->
<configuration>
<wsdlFile>src/main/resource/wsdl/wsdlfile.wsdl</wsdlFile>
<databindingName>adb</databindingName> 
<packageName>com.vendorproduct.ws.wsdl</packageName>
<outputDirectory>src/main/java</outputDirectory>
<unpackClasses>true</unpackClasses>
<unwrap>true</unwrap>
<syncMode>sync</syncMode>
</configuration>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
</execution>
</executions>
</plugin>

无法提供生成的代码,因为需要10个名誉点才能发布2个以上的链接,但问题是生成的代码缺少前缀“http://docs.oasis-open.org/ws-sx/ws-trust/200512\”,因此会出现运行时错误“undeclared xmlns:t=\”“t”。

尝试使用jaxws-maven-plugin (下面的代码片段),但get:无法在项目供应商产品上执行目标类(wsdla):执行错误: wsimport -s,H:\Folder\src\main\java\src,-d,H:\Folder\target\ org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.1:wsimport,-verbose,-p,com.vendorproduct,-Xnocompile,H:\Folder\src\main\resources\filename.wsdl

代码语言:javascript
复制
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>wsdla</id>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.vendorproduct</packageName>
<sourceDestDir>src/main/java</sourceDestDir>
<wsdlFiles>
<wsdlFile>
${basedir}/src/main/resources/filename.wsdl
</wsdlFile>
</wsdlFiles>
<bindingDirectory> <!-- Is this only used for generation output? -->
${basedir}/src/wsdl/binding
</bindingDirectory>
<verbose>true</verbose>
</configuration>
</plugin>

返回到axis2-wsdl2code-maven-plugin并尝试使用xmlbeans作为数据库绑定名称,但得到编译错误:(我相信有所有的axis2依赖项,包括axiom-api-1.2.13和axiom-impl-1.2.13)没有为toEnvelope(org.apache.axiom.soap.SOAPFactory,com.rightnow.ws.messages.GetMetaDataDocument,boolean)方法com.rightnow.ws.wsdl.RightNowSyncServiceStub.toEnvelope(org.apache.axiom.soap.SOAPFactory,org.apache.xmlbeans.XmlString,org.apache.xmlbeans.XmlString,com.rightnow.ws.messages.GetValuesForNamedIDDocument,找到合适的方法布尔值)不适用(实际参数列表和形式参数列表的长度不同)

尽管有编译错误,但它确实以同样不正确的方式生成了存根文件,但没有使用xmlns:t。

切换回使用adb。我使用maven 3.5.0进行了验证,并在命令行上尝试了'mvn package‘,但在没有xmlns:t的情况下以同样不正确的方式生成了存根文件。

Axis2开发者邮件列表显示Axis2 1.6.2已有5年以上的历史,不受支持。将不得不重新编写“旧”源代码以使用最新(和支持的)版本的Axis2。Axis2 1.7.5是最佳选择吗?

EN

回答 1

Stack Overflow用户

发布于 2017-07-14 04:00:35

此问题的根源是使用Axis2 1.6.2。Axis2开发者邮件列表显示Axis2 1.6.2已有5年以上的历史,不受支持。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45016695

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档