wsimport multiple generated wsdl's

2019-07-31 07:34发布

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)

The 3 WSDL files are generated automatically by jbossws at deploy time.

Now I want to generate client code using wsimport.

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)

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.

How do I generate code for the 3 WSDL files, that results in no duplicate code, correct @XmlSeeAlso annotations, and preferably a correct ObjectFactory?

1条回答
Viruses.
2楼-- · 2019-07-31 08:05

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.

查看更多
登录 后发表回答