Celin.AIS - Get Form Definition

CSharp · Console

/Program.cs

using System;
using System.Text.Json;
using System.Threading.Tasks;

namespace Celin
{
	public class Program
	{
		public static async Task Main()
		{
			// Initialise the E1 AIS Client
			var e1 = new AIS.Server("https://demo.steltix.com/jderest/v2/");
			// Set Credentials
			e1.AuthRequest.username = "demo";
			e1.AuthRequest.password = "demo";
			try
			{
				// Make the AIS Request
				// Because there is no Authenticate call, this will use the 
				// username and password for one-off authentication
				var f = await e1.RequestAsync<JsonElement>(
					new AIS.FormRequest
					{
						// The Form to call
						formName = "P01012_W01012A",
						// A Demo Request means that it will only return the
						// Form definition, without data or logic execution
						formServiceDemo = "TRUE"
					});
				// Dump out the Form definition
				Console.WriteLine(f);
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.Message);
			}
		}
	}
}
;