Frage

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?

War es hilfreich?

Lösung

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 {
   ...
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top