Computing > 10 - Requests for Assistance > End of the request

10.7 End of the request

The method GetAssistanceRequestDetails retrieve assistance request details data, a request end when status is completed.

Parameters
requestId
Type: int
Value of type int with request identifier.

 
/// IWsEndUser.IsRequestCompleted Method (c# .NET)
public static bool IsRequestCompleted(WsEndUserClient client,
    int requestId)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    bool retValue = false;

    try
    {
        //call method GetAssistanceRequestDetails, 
        //obtaining a WsResultOfAssistanceRequest item
        WsResultOfAssistanceRequest result = 
            client.GetAssistanceRequestDetails(requestId);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            // verify if the status of request is Completed
            if (result.Value.AssistanceRequestStatus == 
                AssistanceRequestStatus.Completed)
                retValue = true;
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return retValue;
}
// IWsEndUser.IsRequestCompleted Method (JAVA)
public static boolean isRequestCompleted(IWsEndUser client,
    int requestId)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "1234567890");

    boolean retValue = false;

    try
    {
        //call method getAssistanceRequestDetails, 
        //obtaining a WsResultOfAssistanceRequest item
        WsResultOfAssistanceRequest result = 
                client.getAssistanceRequestDetails(requestId);

        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            // verify if the status of request is Completed
            if (result.getValue().getAssistanceRequestStatus() == 
              AssistanceRequestStatus.COMPLETED)
                retValue = true;
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        // show the error
        System.out.println(ex);
    }

    return retValue;
}
Version
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl