...
Once you have run the Powershell command, you will find the new certificate in your Personal folder of the Local machine store.
...
Export this certificate to a file using the default export settings (do not include the private key). Copy this twice - once without the private key, and once with the private key. When exporting with the private key, you will need to supply a password. Copy the no-private-key file over to the Connexion host and install it into the “Trusted People” store of the Local Computer. This can be achieved by right clicking the certificate file (on the Connexion host) and choosing the “install certificate” option.
...
Next, reference the Connexion Core .Api library (Connexion.CoreApi.dll) and create a proxy to Connexion.
Code Block | ||
---|---|---|
| ||
using System; using System.Security.Cryptography.X509Certificates; using Connexion.Core.WebApi; namespace CxnApiClient { class Program { static async Task Main(string[] args) { // load the certificate to pass to the cxngateway api var certificate = new X509Certificate2(@"c:\cxnApitest\apiCertificate.cerapicert.pfx", "foobar"); // create a proxy to the apiConnexion using (var proxy = ConnexionApiProxyFactory.CreateProxy("127.0.0.1", 80878089, certificate)) { // test the connection Console.WriteLine("Query Groups..."); var resultresponse = await proxy.ServiceMethods.GetGroupsAndTabsAsync(new GetGroupsAndTabsRequest(true)); foreach (var group in resultresponse.Groups) { Console.WriteLine(group.Name); foreach (var tab in group.Tabs) { Console.WriteLine($"{group.Name} ({group.GroupKey}) / {-->{tab.Name} ({tab.TabKey})"); } } } Console.ReadLine(); } } } |
...
At this point, you can now make API calls. Please use the async/await pattern (the above code is a contrived example only).
...