Apache Axis2 웹 서비스에서 예외 처리가 발생합니다. 내 몸이 클래스는 내 클라이언트 클래스, 내가 이런 식으로이 문제를 처리하고 내부 내 몸이 클래스Axis2 : 사용자 정의 예외 처리
public samples.quickstart.xsd.GetPriceResponse getPrice(
samples.quickstart.xsd.GetPrice getPrice0)
throws GetSolutionByIdFault {
samples.quickstart.xsd.GetPriceResponse response = new samples.quickstart.xsd.GetPriceResponse();
response.set_return("Hi");
String value = (String) getPrice0.getSymbol();
if (value.equals("Pavan"))
throw new GetSolutionByIdFault("name not present");
return response;
}
내부 WSDL 파일
내부에 구성한 "NoUserFound"로라는 이름의 사용자 정의 된 예외가 발생합니다 : 사용자 정의 예외는 예 (GetSolutionByIdFault)에 대해 발생하므로 적
try {
// Some Logic here
}
catch (AxisFault er) {
er.getMessage();
}
catch (Exception e) {
e.printStackTrace();
}
, 난 AxisFault 블록을 취급하고있다.
이 올바른 접근 방법입니까 ??