Apache의 XML-RPC 구현을 통해 반환되는 예외에서 원래 예외를 추출하는 가장 쉬운 방법은 무엇입니까?Apache XML-RPC 예외 처리
3
A
답변
3
그것은 아파치 예외에서 원인 예외를 점점 올바른 것으로 밝혀졌습니다.
} catch (XmlRpcException rpce) {
Throwable cause = rpce.getCause();
if(cause != null) {
if(cause instanceof ExceptionYouCanHandleException) {
handler(cause);
}
else { throw(cause); }
}
else { throw(rpce); }
}
1
XML-RPC Spec에 따르면 xml에 "fault"를 반환합니다.
XML-RPC 호출을 수행하는 동안 생성 된 Java Exception을 참조하거나 참조하는 "예외"입니까?
오류의 예를
HTTP/1.1 200 OK
Connection: close
Content-Length: 426
Content-Type: text/xml
Date: Fri, 17 Jul 1998 19:55:02 GMT
Server: UserLand Frontier/5.1.2-WinNT
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>4</int></value>
</member>
<member>
<name>faultString</name>
<value>
<string>Too many parameters.</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
+0
을 사용하고 있습니다. 기본 인증이 사용되었다고 가정 해 봅시다. 헤더를 HTTP/1.1 401 권한을 얻지 못하게하려면 어떻게해야합니까? –
이 질문의 컨텍스트는 무엇입니까? XML-RPC를 직접 사용하고 있습니까? – ScArcher2
Apache의 구현, 즉 http://ws.apache.org/xmlrpc/ –