using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using enduser.LACEnduserAPI; namespace EnduserAPIExample { class Program { static void Main(string[] args) { string strActKey = "X0BQG-WXZ2G-7AFO1-5HZ6M"; string strHostid = "HOSTNAME=my_hostname"; enduser.LACEnduserAPI.LAC_EnduserPortClient Client = new enduser.LACEnduserAPI.LAC_EnduserPortClient(); enduser.LACEnduserAPI.Soap_Response_License Response = Client.CreateLicenseRequest(strActKey, strHostid); if (Response.result_code != 0) { PrintResponse(Response); return; } do { Response = Client.GetLicense(strActKey, strHostid); if (Response.result_code != 1) break; System.Threading.Thread.Sleep(2000); } while (Response.result_code != 0); PrintResponse(Response); } static void PrintResponse(enduser.LACEnduserAPI.Soap_Response_License Response) { Console.WriteLine("Result code: " + Response.result_code.ToString()); Console.WriteLine("Result string: " + Response.result_string); } } }