def handle_response(exe, name, location, response)
      result = @serializer.load(response)

      if result.success?
        if  result.content
          # Since we only ask for one credential at a time, we can do this...
          secure_document = result.content.first
          if secure_document.envelope_mime_type.nil?
            @executables_inputs[exe][name] = secure_document
            @audit.append_info("Got #{name} of '#{exe.nickname}'; #{count_remaining} remain.")
            if done?
              @audit.append_info("All credential values have been retrieved and processed.")
              report_success
            end
          else
            # The call succeeded but we can't process the credential value
            msg = "The #{name} input of '#{exe.nickname}' was retrieved from the external source, but its type " +
                  "(#{secure_document.envelope_mime_type}) is incompatible with this version of RightLink."
            report_failure('Cannot process credential', msg)
          end
        end
      else # We got a result, but it was a failure...
        msg = "Could not retrieve the value of the #{name} input of '#{exe.nickname}' " +
              "from the external source. Reason for failure: #{result.content}."
        report_failure('Failed to retrieve credential', msg)
      end
    rescue Exception => e
      msg = "An unexpected error occurred while retrieving the value of the #{name} input of '#{exe.nickname}.'"
      report_failure('Unexpected error while retrieving credentials', msg, e)
    end
def handle_response(exe, name, location, response)
      result = @serializer.load(response)

      if result.success?
        if  result.content
          # Since we only ask for one credential at a time, we can do this...
          secure_document = result.content.first
          if secure_document.envelope_mime_type.nil?
            @executables_inputs[exe][name] = secure_document
            @audit.append_info("Got #{name} of '#{exe.nickname}'; #{count_remaining} remain.")
            if done?
              @audit.append_info("All credential values have been retrieved and processed.")
              report_success
            end
          else
            # The call succeeded but we can't process the credential value
            msg = "The #{name} input of '#{exe.nickname}' was retrieved from the external source, but its type " +
                  "(#{secure_document.envelope_mime_type}) is incompatible with this version of RightLink."
            report_failure('Cannot process credential', msg)
          end
        end
      else # We got a result, but it was a failure...
        msg = "Could not retrieve the value of the #{name} input of '#{exe.nickname}' " +
              "from the external source. Reason for failure: #{result.content}."
        report_failure('Failed to retrieve credential', msg)
      end
    rescue Exception => e
      msg = "An unexpected error occurred while retrieving the value of the #{name} input of '#{exe.nickname}.'"
      report_failure('Unexpected error while retrieving credentials', msg, e)
    end
Handle a RightNet response to our retryable request. Could be success, failure or unexpected.