문제

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?

도움이 되었습니까?

해결책

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 {
   ...
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top