1.1 Regions

By the method GetRegions you can show the list of available Regions.

Returns
The method returns a WsResultOfArrayOfRegion item with information on the result of the call to the method and the list of regions.
 
//WsCloudStorage.GetRegions Method (c# .NET)
private static String GetRegions(WsCloudStorageClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetRegions,
        //obtaining a WsResultOfArrayOfRegion item
        WsResultOfArrayOfRegion result = client.GetRegions();
        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            Region[] arrayOfRegion = result.Value;
            //browse the list and print the values
            foreach (Region region in arrayOfRegion)
            {
                int id = region.RegionID;
                String code = region.RegionCode;
                String description = region.Description;
                stringBuilder.Append("id: ");
                stringBuilder.Append(id);
                stringBuilder.Append(" code: ");
                stringBuilder.Append(code);
                stringBuilder.Append(" description: ");
                stringBuilder.Append(description);

            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }
    System.Console.WriteLine("stringBuilder.ToString()" + stringBuilder.ToString());
    return stringBuilder.ToString();
}
//IWsCloudStorage.GetRegions Method Method (JAVA)
private static String GetRegions(IWsCloudStorage client)
{
    //specify the account login details 

    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "1234567890");

    StringBuilder sb = new StringBuilder();

    try
    {
        // call method GetRegions,
        // obtaining a WsResultOfArrayOfRegion item
        WsResultOfArrayOfRegion result = client.getRegions();

        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            ArrayOfRegion arrayOfRegion = result.getValue();

            List<Region> listOfRegion = arrayOfRegion.getRegion();

            //browse the list and print the values
            for (Iterator<Region> it = listOfRegion.iterator(); it.hasNext();)
            {
                Region region = it.next();
                Integer regionId = region.getRegionID();
                String description = region.getDescription();
                String regionCode = region.getRegionCode();
                sb.append("regionId: ");
                sb.append(regionId);
                sb.append(" description: ");
                sb.append(description);
                sb.append(" regionCode: ");
                sb.append(regionCode);

            }
        }
        else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    }
    catch (Exception ex)
    {
        //show error
        System.out.println(ex);
    }

    //show result
    System.out.println("sb: " + sb.toString());
    return sb.toString();
}
Versione
API: v2.8 URL: https://api.services.cloud.it/wsCloudStorage/v2.8/WsCloudStorage.svc?wsdl