Question

Web Service Newbie Question:

wsimport generates two classes: MyException and MyException_Exception for my wsdl-File, but MyException does not extend Exception. How to change this?

Was it helpful?

Solution

Ok, I got it. The wsimport tool generates

  • one class for the xml type and
  • one class for the Exception.

This results in a name collision. Therefor the _Exception prefix is added to the wanted class.

The solution is to give the xml type a different name.

This is done by annotating the server-side class:

@XmlType(name = "UnknownDomainExceptionType", namespace = "...")
public class MyException extends Exception {
   ...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top