Skip to main content

Handle Response

Each RDA web service response contains the following fields.

NAMEDESCRIPTION
CredentialsA security token representing an authenticated user which will be used in subsequent calls. The token expires after 20 minutes.
RequestIdUnique identifier used to identify the request associated with the response.
ResultValue indicating type of result. Possible values: Error (default), Success, ValidationError, NoChange
ResultCodeCan be Error or Resource code depending on type of result.
ResultMessageMessage regarding details of the Result.
ValidationResultsArray of ValidationResult objects containing messages regarding input validation.

Credentials will contain a security token when the Result is Success. This token should be assigned to the Credentials property in the next web service request.

RequestId can be used to match a request and response. This is useful when requests are made asynchronously. Multiple requests can be outstanding and order of completion is not guaranteed.

Result will contain one of the enumerated values which can be used to determine how to handle the response.

ResultMessage may contain a message that provides additional information regarding the Result value. This is particularly useful for the Error result as it may contain an explanation of the error.

ValidationResults will contain and array of ValidationResult items when the Result is ValidationError. ValidationResult contains the following fields.

NameDescription
CodeValue assigned by EPS for the validation result.
MessageMessage explaining the validation result.

C# Example

    private bool CheckSuccess(AuthenticatedResponse response)
{
bool isSuccess = response != null && response.Result == ResponseResultType.Success;
if (isSuccess)
{
//set the token credentials to the latest value
credentials = response.Credentials;
}
return isSuccess;
}

private void HandleOther(AuthenticatedResponse response)
{
if (response.Result == ResponseResultType.Error)
{
Console.WriteLine(response.ResultCode + ":" + response.ResultMessage);
}
else if (response.Result == ResponseResultType.ValidationError)
{
foreach (var validation in response.ValidationResults)
{
Console.WriteLine(validation.Code + ":" + validation.Message);
}
}
}