Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
using System;
using System.Security.Cryptography.X509Certificates;
using Connexion.Core.WebApiApi;

namespace CxnApiClient
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // load the certificate to pass to the gateway api
            var certificate = new X509Certificate2(@"c:\test\apicert.pfx", "foobar");

            // create a proxy to Connexion
            using (var proxy = ConnexionApiProxyFactory.CreateProxy("127.0.0.1", 8089, certificate))
            {
                // test the connection
                Console.WriteLine("Query Groups...");
                var response = await proxy.ServiceMethods.GetGroupsAndTabsAsync(new GetGroupsAndTabsRequest(true));
                foreach (var group in response.Groups)
                {
                    Console.WriteLine(group.Name);
                    foreach (var tab in group.Tabs)
                    {
                        Console.WriteLine($"-->{tab.Name}");
                    }
                }
            }

            Console.ReadLine();
        }
    }
}

...