Knowledge Center

NAServer – The starting point

Developers are provided with a primary entry point to the API: NAServer (or NA_Server). This class offers access to most of the functionality needed, such as the various interfaces used in remote communications.

The toolkits offer similar factory methods to get an NAServer instance, requiring a host address and optionally other information such as user/password. The toolkits differ somewhat when requesting an instance.

  • Java/.NET offer quiescent creation, only contacting the system when you make a remote call. These toolkits also have instances that can be used throughout the application lifetime without concern for the server being online throughout.
  • C++/Python contact the server on creation. A server that is offline will fail this test.

When accessing a server, the following pattern should be followed.

  • Check if your system is online for toolkits that require such (C++/Python)
  • Get an NAServer instance and set login credentials (details may differ slightly between toolkits)
// C#
NAServer svr = NAServer.GetServer("192.168.20.27");
svr.Credentials = new NetworkCredential(userName, password);

// Python
server = NA_Server("172.20.0.27")
server.SetUsernamePassword(userName, password)
  • Log in
  • Do your work
  • Log out

Your Work

Once you have your NAServer instance, there are a multitude of interfaces you can utilize. We’ll explore these over the course of these articles.

Best Practices

Once you have successfully connected to the server, you can get at the various interfaces to do your work. When making remote calls, make sure to handle exceptions and follow some best practices.

  • Refer to the language-specific manual for any best practices mentioned
  • Remote exceptions such as NA_Exception, SystemException, etc., may have members or fields atypical to the language, handle these explicitly if possible, or use any utilities recommended by your language-specific manual. For instance,
// C#
catch (Exception ex)
{
   Exception refined = NaExceptionFactory.GetSingleton().GenerateException(ex, svr);
   // ...
}

Next: Configuration part 1

Is NetAcquire a good fit for your project?

Our applications engineers will discuss your needs and offer advice and pricing for the solutions we can provide.
NetAcquire provides quick responses to phone and email queries during Pacific Time business hours.

Call us toll free: 888-675-1122 or email [email protected]

For Employment, Business Affairs and other NetAcquire Contacts, CONTACT US

NetAcquire Corporation