Skip to content
Advertisement

wsimport – Two declarations cause a collision, same line given

Trying to use wsimport to generate a client for a SOAP endpoint. The WSDL and all XSD files used are local copies.

This is the command being executed:

JavaScript

Which gives this error:

JavaScript

Note the line number is the same for the reported collision.

Here’s the schema:

JavaScript

I’ve tried removing the type definition, but it’s referenced in a slew of other places.

Could anyone please offer any advice for how to get this to work?

Thanks

Edit:

Here’s the lines where the WSDL imports these schemas:

JavaScript

Advertisement

Answer

Thanks to the help of @Petru Gardea I was able to eventually get past this by omitting the -p com.generated package specification to wsimport. So this is what I was eventually able to run to get past this problem:

JavaScript

The reasoning for it is wsimport is trying to generate classes in the same package with the same name and/or methods, which it obviously cannot do.

So by omitting the forced package declaration, wsimport is able to put the classes in whatever packages it wants, which turns out to be 3 different packages per the <xsd:schema> definition in the WSDL.

Thanks again @Petru!

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement