Skip to main content

Handle Response

Each RDA Admin web service response contains the following fields.

NameDescription
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.

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 JHA for the validation result.
MessageMessage explaining the validation result.

Below is example code for response handling.

C# Example

private bool CheckSuccess(AuthenticatedResponse response)
{
return response != null && response.Result == ResponseResultType.Success;
}

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);
}
}
}