raz*_*nha 39 .net java axis web-services wsimport
我正在尝试使用JDK 6工具为一些SOAP Web服务生成客户端wsimport.WSDL由.NET 2.0应用程序生成.对于.NET 3.X应用程序,它工作正常.
我跑的时候
wsimport -keep -p mypackage http://myservice?wsdl
Run Code Online (Sandbox Code Playgroud)
它显示了几个错误消息,如下所示:
[错误]具有相同名称"mypackage.SomeClass"的类/接口已在使用中.使用类自定义来解决此冲突.线?的HTTP://为MyService WSDL
当我使用Axis 1.4(使用Eclipse WebTools插件)生成Web服务客户端时.
有人知道我该怎么做才能使用这个wsimport工具吗?我真的不明白"类定制"是什么.
Pau*_*ulH 88
我不知道这是否曾经解决,但我花了一些时间谷歌搜索解决同样的问题.
我在这里找到了解决方法 - https://jax-ws.dev.java.net/issues/show_bug.cgi?id=228
解决方案是使用-B-XautoNameResolution(无空格)运行wsimport
小智 21
对于使用maven阅读此内容的任何人,这是如何将其添加到.pom文件中.请注意配置部分中的args.这在文档中不是很容易找到.非常感谢Isaac Stephens对此的帮助.
<!-- definition for ERPStandardWork service -->
<execution>
<id>ERPStandardWorkService</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<!-- this resolves naming conflicts within the wsdl - there are several copies of fault report objects which clash otherwise. -->
<args>
<arg>-B-XautoNameResolution</arg>
</args>
<wsdlDirectory>${basedir}/src/main/resources/META-INF/wsdl</wsdlDirectory>
<wsdlFiles>
<wsdlFile>ERPStandardWork.wsdl</wsdlFile>
</wsdlFiles>
<wsdlLocation>${basedir}/src/main/resources/META-INF/wsdl/ERPStandardWork.wsdl
</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/ERPStandardWork/.staleFlag
</staleFile>
</configuration>
</execution>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
34013 次 |
| 最近记录: |