Storage > 2 - Account Management > Reset Password

2.3 Reset Password

By the method SetCloudStorageAccountResetPassword you can reset a Cloud Storage Account password. The new password will be sent in email.

Parameters
cloudStorageAccountId
Type: int
Value of type int with the Cloud Storage Account identifier.
 
/// WsCloudStorage.SetCloudStorageAccountResetPassword Method (c# .NET)
public static string SetCloudStorageAccountResetPassword (WsCloudStorageClient client,
    int cloudStorageAccountId)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method SetCloudStorageAccountResetPassword, 
        // obtaining a WsCloudStorage.WsResult item
        WsCloudStorage.WsResult result = 
            client.SetCloudStorageAccountResetPassword(cloudStorageAccountId);

        // if the call is successfull return code e message else  re-run the error
        if (result.Success)
        {
            // print the result code and message
            stringBuilder.Append("Code: ");
            stringBuilder.Append(result.ResultCode);
            stringBuilder.Append(" - Message: ");
            stringBuilder.Append(result.ResultMessage);
        }
        else
        {
            throw new ApplicationException(result.ExceptionInfo._fullString);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString(); 
}
/// WsCloudStorage.SetCloudStorageAccountResetPassword Method (JAVA)
public static String setCloudStorageAccountResetPassword (IWsCloudStorage client,
    int cloudStorageAccountId, String newPassword, String oldPassword)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method SetCloudStorageAccountResetPassword, 
        // obtaining a WsCloudStorage.WsResult item
        WsResult result = 
            client.setCloudStorageAccountPassword
                (cloudStorageAccountId, newPassword, oldPassword);

        // if the call is successfull return code e message else  re-run the error
        if (result.isSuccess())
        {
            // print the result code and message
            stringBuilder.append("Code: ");
            stringBuilder.append(result.getResultCode());
            stringBuilder.append(" - Message: ");
            stringBuilder.append(result.getResultMessage());
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        // show the error
        System.out.println(ex);
    }

    return stringBuilder.toString(); 
}
Versione
API: v2.8 URL:https://api.services.cloud.it/wsCloudStorage/v2.8/WsCloudStorage.svc?wsdl