-
Apr 1st, 2009, 08:18 AM
#1
WebServiceTemplate.hasFault doesn't check the message
WebServiceTemplate.hasFault only checks the message if there is a fault with the connection, or the connection has not been checked. This does not match the documentation:
@return true if either the connection or the message has a fault; false otherwise
protected boolean hasFault(WebServiceConnection connection, WebServiceMessage response) throws IOException {
if (checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection) {
// check whether the connection has a fault (i.e. status code 500 in HTTP)
FaultAwareWebServiceConnection faultConnection = (FaultAwareWebServiceConnection) connection;
if (!faultConnection.hasFault()) {
return false;
}
}
if (response instanceof FaultAwareWebServiceMessage) {
// either the connection has a fault, or checkConnectionForFault is false: let's verify the fault
FaultAwareWebServiceMessage faultMessage = (FaultAwareWebServiceMessage) response;
return faultMessage.hasFault();
}
return false;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules