Announcement Announcement Module
Collapse
No announcement yet.
WebServiceTemplate.hasFault doesn't check the message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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;
    }
Working...
X