Esempio n. 1
0
        } // END METHOD

        /// <summary>
        /// Asynchonous Soap Call to get the ECGridOS SessionInfo
        /// Uses private variable for APIKey - must be set prior to calling
        /// Converts EAP pattern into TAP pattern to use async/await from ECGridAPIAsync Class
        /// </summary>
        /// <param name="APIKey">String APIKey/SessionID in GUID Format for ECGridOS</param>
        /// <returns>net.ecgridos.SessionInfo Class: User Session information</returns>
        public async Task <ECGridOS_API.SessionInfo> SessionInfoAsync(string APIKey)
        {
            try
            {
                using (ECGridOS_API.ECGridOSAPIv3 ECGridOS = new ECGridOS_API.ECGridOSAPIv3())
                {
                    // Check to make sure it is in valid Guid Format
                    if (IsValidGUID(_apiKey))
                    {
                        // Make the call and return the results
                        var AsyncTask = await ECGridAPIAsync.SessionInfoAsync(ECGridOS, APIKey);

                        return(AsyncTask.Result);
                    }
                    else
                    {
                        throw new Exception("Invalid GUID API Key");
                    }
                }
            }
            catch (SoapException SoapEx)
            {
                // SOAP Exceptions
                Console.WriteLine(ECGridAPI.ShowSoapError(SoapEx));
                return(null);
            }
        } // END METHOD
Esempio n. 2
0
        } // END METHOD

        /// <summary>
        /// Synchonous Soap Call to get the ECGridOS SessionInfo
        /// </summary>
        /// <param name="APIKey">String APIKey/SessionID in GUID Format for ECGridOS</param>
        /// <returns>net.ecgridos.SessionInfo Class: User Session information</returns>
        public ECGridOS_API.SessionInfo SessionInfo(string APIKey)
        {
            try
            {
                using (ECGridOS_API.ECGridOSAPIv3 ECGridOS = new ECGridOS_API.ECGridOSAPIv3())
                {
                    // Check to make sure it is in valid Guid Format
                    if (IsValidGUID(APIKey))
                    {
                        // Make the call and return the results
                        return(ECGridOS.WhoAmI(APIKey));
                    }
                    else
                    {
                        throw new Exception("Invalid GUID API Key");
                    }
                }
            }
            catch (SoapException SoapEx)
            {
                // SOAP Exceptions
                Console.WriteLine(ECGridAPI.ShowSoapError(SoapEx));
                return(null);
            }
        } // END METHOD
Esempio n. 3
0
 /// <summary>
 /// Synchonous Soap Call to get the ECGridOS Version
 /// </summary>
 /// <returns>String: ECgridOS Version</returns>
 public string APIVersion()
 {
     try
     {
         using (ECGridOS_API.ECGridOSAPIv3 ECGridOS = new ECGridOS_API.ECGridOSAPIv3())
         {
             // Make the call and return the results
             return(ECGridOS.Version());
         }
     }
     catch (SoapException SoapEx)
     {
         // SOAP Exceptions
         return(ECGridAPI.ShowSoapError(SoapEx));
     }
 } // END METHOD
Esempio n. 4
0
        } // END METHOD

        /// <summary>
        /// Asynchonous Soap Call to get the ECGridOS Version
        /// Converts EAP pattern into TAP pattern to use async/await from ECGridAPIAsync Class
        /// </summary>
        /// <returns>Task string: ECGridOS Version</returns>
        public async Task <string> APIVersionAsync()
        {
            try
            {
                using (ECGridOS_API.ECGridOSAPIv3 ECGridOS = new ECGridOS_API.ECGridOSAPIv3())
                {
                    // Make the call and await the results to return
                    var AsyncTask = await ECGridAPIAsync.VersionAsync(ECGridOS);

                    return(AsyncTask.Result);
                }
            }
            catch (SoapException SoapEx)
            {
                // SOAP Exceptions
                return(ECGridAPI.ShowSoapError(SoapEx));
            }
        } // END METHOD