Exception when defining method-specific exceptions. For example:
@WebMethod(operationName = "GetMember", action = "GetMember")
public void getMember(@WebParam(name = "MemberID")
Long memberID,
@WebParam(name = "Member",
mode = Mode.OUT)
Holder member)
throws InvalidMemberID {
if (! isValid(memberID)) {
throw new InvalidMemberID(memberID);
}
...
}
I originally named the exception InvalidMemberIDException, but this results in a SOAP fault with the same name in the WSDL, rather than just InvalidMemberID. The client tool wsimport will then use this WSDL to generate an exception named InvalidMemberIDException_Exception.
1 comment:
how about using @WebFault annotation to customize exception naming in service? That way you can retain conventional naming in Java while removing the "-Exception" suffix for the WS.
-g
Post a Comment