wsimport 多个生成的 wsdl's [英] wsimport multiple generated wsdl's
问题描述
我正在使用 jbossws(带有 jax-ws)来提供从带注释的 POJO 生成的 3 个 Web 服务.这 3 个 web 服务共享一些数据类,也有一个通用的方法 (ping
).它们都驻留在同一个 java 包中(namespace
)
I am using jbossws (with jax-ws) to serve 3 webservices generated from annotated POJOs.
These 3 webservices share a few data classes and also have a common method (ping
).
They all reside in the same java package (namespace
)
这 3 个 WSDL 文件在部署时由 jbossws
自动生成.
The 3 WSDL files are generated automatically by jbossws
at deploy time.
现在我想使用 wsimport 生成客户端代码.
Now I want to generate client code using wsimport.
当我一个一个地导入 WSDL 文件时,尽管有一些怪癖(ObjectFactory.java
被覆盖,@XmlSeeAlso
未列出所有子类),但它以某种方式起作用了
When I import the WSDL files one by one, this somehow works allthough there are some quirks (ObjectFactory.java
overwritten, @XmlSeeAlso
not listing all subclasses)
当我一次性导入 3 个 WSDL 文件时,该工具开始抱怨重复定义(例如 [ERROR] 'ping' is already defined
)并且不生成任何内容.
When I import the 3 WSDL files in one go, the tool starts complaining about duplicate definitions (e.g. [ERROR] 'ping' is already defined
) and does not generate anything.
我曾尝试更改命名空间,但这会导致多个包,并且可能会导致客户端的某些类重复.
I have tried changing namespaces, but that would lead to several packages and perhaps duplication of some classes on the client side.
我如何为 3 个 WSDL 文件生成代码,从而不会产生重复代码、正确的 @XmlSeeAlso
注释,以及最好是正确的 ObjectFactory
?
How do I generate code for the 3 WSDL files, that results in no duplicate code, correct @XmlSeeAlso
annotations, and preferably a correct ObjectFactory
?
推荐答案
我会首先使用 -extension 标志来查看它是否有效".扩展有时会有所帮助,尤其是对于重复的属性名称.
I'd start by using the -extension flag to see if it just "works". The extensions sometimes help, particularly with duplicate property names.
如果问题是方法/属性名称冲突,您可能需要对其进行自定义.
If the problem is a method/property name collision, you'll probably have to customize it.
这篇关于wsimport 多个生成的 wsdl's的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!