Computing > 10 - Requests for Assistance > Insert assistance request

10.2 Insert assistance request

The method SetInsertAssistanceRequest is aimed to insert an assistance request. User can specify subject, body of the request and optionally a virtual server involved. Request status will be “Draft” so the system will not send the request to the assistance team. User must insert email address, full name and phone number.

Parameters
requestSubject
Type: string
Value of type string with request subject.

requestBody
Type: string
Value of type string with request body.

email
Type: string
Value of type string with customer email.

fullName
Type: string
Value of type string with customer full name.

phoneNumber
Type: string
Value of type string with customer phone number.

virtualMachineID
Type: int
Value of type int with virtual server identifier

 
// IWsEndUser.SetInsertAssistanceRequest Method (c# .NET)
public static string SetInsertAssistanceRequest(WsEndUserClient client,
    string requestSubject, string requestBody, string email,
    string fullName, string phoneNumber, int virtualMachineID)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the object NewAssistanceRequest  for the request 
        // with data to process
        NewAssistanceRequest request = new NewAssistanceRequest();
                
        // mandatory fields
        request.AssistanceRequestSubject = requestSubject;
        request.AssistanceRequestBody = requestBody;
        request.CustomerEmail = email;
        request.CustomerFullName = fullName;
        request.CustomerPhoneNumber = phoneNumber;

        // other optional fields
        request.Language = Languages.en;                
        request.VirtualMachineID = virtualMachineID;

        //call method SetInsertAssistanceRequest, 
        //obtaining a WsResult item
        WsResult result = client.SetInsertAssistanceRequest(request);

        //if the call is not successful, re-run the error indicating the message
        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.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString(); 
}
// IWsEndUser.SetInsertAssistanceRequest Method (JAVA)
private static String setInsertAssistanceRequest(IWsEndUser client,
    String requestSubject, String requestBody, String email,
    String fullName, String phoneNumber, int virtualMachineID)
{
    //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
    {
        // create the object NewAssistanceRequest  for the request 
        // with data to process
        NewAssistanceRequest request = new NewAssistanceRequest();

        // mandatory fields
        
        request.setAssistanceRequestSubject(requestSubject);
        request.setAssistanceRequestBody(requestBody);
        request.setCustomerEmail(email);
        request.setCustomerFullName(fullName);
        request.setCustomerPhoneNumber(phoneNumber);

        // other optional fields
        request.setLanguage(Languages.EN);
        request.setVirtualMachineID(virtualMachineID);

        //call method setInsertAssistanceRequest, 
        //obtaining a WsResult item
        WsResult result = client.setInsertAssistanceRequest(request);

        //if the call is not successful, re-run the error indicating the message
        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);
    }

    System.out.println("StringBuilder: "+StringBuilder);
    
    return StringBuilder.toString();
}
Versione
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl