0 Replies Latest reply on Jan 28, 2016 3:55 AM by hilll

    HEAT Integration Web Service - Licensing

    hilll Rookie

      I'm using the HEAT Integration Web Service in my App to connect to HEAT to retrieve ticket information and eventually to close the tickets. I was wondering if anyone knows how the licensing works around this?

       

      I use the following to connect to HEAT and check if a ticket is valid. For a ticket to be 'valid' it must exist and have an active status.

       

       

              FRSHEATIntegration frSvc = new FRSHEATIntegration();

       

       

              //Check connection

              private string getSession()

              {

                  try

                  {

                      FRSHEATIntegrationConnectionResponse response = frSvc.Connect(username, password, tenant, role);

       

       

                      if(response.connectionStatus == "Success")

                      {

                          return response.sessionKey;

                      }

                      else

                      {

                          MessageBox.Show(response.exceptionReason);

                         

                          return "";

                      }

                     

                  }

                  catch(Exception ex)

                  {

                      MessageBox.Show(ex.Message);

                      return "";

                  }

              }

       

       

              //Check ticket valid

              public bool checkTicket(string ticketNo)

              {

                  try

                  {

                      ObjectQueryDefinition query = new ObjectQueryDefinition();

                      FieldClass[] fieldObjects = new FieldClass[] {

                          new FieldClass()

                          {

                                  Name = "Status",

                                  Type = "Text"

                          }

                      };

                      query.Select = new SelectClass();

                      query.Select.Fields = fieldObjects;

                      query.From = new FromClass();

                      query.From.Object = "servicereq";

                      query.Where = new RuleClass[]

                      {

                              new RuleClass()

                              {

                                  Condition= "=",

                                  Field = "ServiceReqNumber",

                                  Value = ticketNo

                              },

       

       

                      };

       

                      string key = getSession();

       

                      if (key != "")

                      {

                          FRSHEATIntegrationSearchResponse response = frSvc.Search(key, tenant, query);

                          if(response.status != "Success")

                          {

                              MessageBox.Show(response.exceptionReason);

                              MessageBox.Show("Ticket number doesn't exist.", "Ticket Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);

                              return false;

                          }

                          else

                          {

                              if (response.objList[0][0].FieldValues[0].Value.ToString() != "Active")

                              {

                                  MessageBox.Show("Ticket status is not set to Active.", "Ticket Status", MessageBoxButtons.OK, MessageBoxIcon.Error);

                                  return false;

                              }

                              else

                              {

                                  return true;

                              }

                          }

                      }

                      else

                      {

                          MessageBox.Show("Unable to connect to HEAT.");

                          return false;

                      }

                  }

                  catch (Exception ex)

                  {

                      MessageBox.Show(ex.Message);

                      return false;

                  }

          

              }

       

      While this check runs for the seconds it takes would it be 'using a licence' and then expire?

       

      Thanks,

      Lewis