Computing > 11 - Private Cloud > Get purchased Custom Product details

11.9 Get purchased Custom Product details

By the method IWSCommon GetPurchasedCustomProductDetails you can retrieve the details of a purchased custom product.
 
    /// IWsCommon.GetPurchasedCustomProductDetails Method (c# .NET)
    public static string GetPurchasedCustomProductDetails(WsCommonClient client, 
        int customProductId)
    {
        //specify the account login details 
        client.ClientCredentials.UserName.UserName = "ARU-0000";
        client.ClientCredentials.UserName.Password = "0123456789";

        StringBuilder stringBuilder = new StringBuilder();

        try
        {
            // call method WsResultOfCustomProductDetails 
            // obtaining a GetPurchasedCustomProductDetails item
            WsResultOfCustomProductDetails result =
                client.GetPurchasedCustomProductDetails(customProductId);

            // if the call is Success print returned values
            if (result.Success)
            {
                stringBuilder.Append("Operation ends successfully\n");

                // get Value returned from server
                CustomProduct item = result.Value;

                if (item != null)
                {
                    stringBuilder.Append("Custom Product detail\n");

                    stringBuilder.Append("\nProductID: ");
                    stringBuilder.Append(item.ProductID);
                    stringBuilder.Append("\nCustomProductID: ");
                    stringBuilder.Append(item.CustomProductID);
                    stringBuilder.Append("\nName: ");
                    stringBuilder.Append(item.ProductName);
                    stringBuilder.Append("\nQuantity: ");
                    stringBuilder.Append(item.Quantity);
                    stringBuilder.Append("\nDescription: ");
                    stringBuilder.Append(item.ProductDescription);
                    stringBuilder.Append("\nBillingType: ");
                    stringBuilder.Append(item.BillingType);
                    stringBuilder.Append("\nExpiryDate: ");
                    stringBuilder.Append(item.ExpiryDate);
                    stringBuilder.Append("\nPrice: ");
                    stringBuilder.Append(item.Price);

                }
            }
            else
            {
                throw new ApplicationException(result.ResultMessage);
            }
        }
        catch (Exception ex)
        {
            // re-run the error
            throw new ApplicationException(ex.Message);
        }

        return stringBuilder.ToString();
    }
    
    /// IWsCommon.getPurchasedCustomProductDetails Method (JAVA)
    public static String getPurchasedCustomProductDetail(IWsCommon client, 
        int customProductId)
    {            
        //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 getPurchasedCustomProductDetails 
            // obtaining a WsResultOfCustomProductDetails item
            WsResultOfCustomProductDetails result =
                client.getPurchasedCustomProductDetails(customProductId);

            // if the call is Success print returned values
            if (result.isSuccess())
            {
                stringBuilder.append("Operation ends successfully\n");

                    // get Value returned from server
                if (result.getValue()!= null)
                {
                    CustomProductDetails item = result.getValue();   

                    if (item != null)
                    {
                        stringBuilder.append("Custom Product Details\n");

                        stringBuilder.append("\nProductID: ");
                        stringBuilder.append(item.getProductID());
                        stringBuilder.append("\nCustomProductID: ");
                        stringBuilder.append(item.getCustomProductID());
                        stringBuilder.append("\nName: ");
                        stringBuilder.append(item.getProductName());
                        stringBuilder.append("\nQuantity: ");
                        stringBuilder.append(item.getQuantity());
                        stringBuilder.append("\nDescription: ");
                        stringBuilder.append(item.getProductDescription());
                        stringBuilder.append("\nBillingType: ");
                        stringBuilder.append(item.getBillingType());
                        stringBuilder.append("\nExpiryDate: ");
                        stringBuilder.append(item.getExpiryDate());
                        stringBuilder.append("\nPrice: ");
                        stringBuilder.append(item.getPrice());
                    }
                }
                    
            }
            else
            {
                throw new Exception(result.getResultMessage());
            }
        }
        catch (Exception ex)
        {
            // re-run the error
                System.out.println(ex);
        }

        return stringBuilder.toString();
    }
    
Version
API: v2.8 URL:https://api.dc1.computing.cloud.it/WsCommon/v2.8/WsCommon.svc?wsdl