Click or drag to resize

Library Overview

Linkar Framework for .NET and Core


Dependencies: Linkar.Functions.Direct

In this library you can find the diferent Persistent and Direct SendCommand functions:

This one function can be used to perform all common CRUD requests, to execute TCL/ECL commands, to run subroutines, and to format data. This is simply an alternative method to access a database, compared to using individual single-purpose client functions. For example, a desktop application might use the SendCommand functions to log a message into the database, or to do a quick retrieval of a name related to an ID. The lksendcommand.exe program uses this function to perform operations on remote MV databases.

Among the parameters for this function (detailed below) is the commandFormat parameter. This is set to an enumeration value to specify the format being used for the command string, either XML or JSON. The command parameter is the request itself in the specified format.

As an example of usage, to send an XML request to Execute the command "COUNT fileName", the SendCommand parameter commandFormat will be the enum value ENVELOPE_FORMAT.XML, and the command payload will be as follows:

XML
<COMMAND NAME="EXECUTE">
  <STATEMENT>COUNT fileName</STATEMENT>
  <CUSTOM_VARS></CUSTOM_VARS>
  <OUTPUT_FORMAT>MV</OUTPUT_FORMAT>
</COMMAND>

If commandFormat is set to ENVELOPE_FORMAT.JSON, the command value will be

JSON
{ "NAME" : "EXECUTE", "COMMAND" :
  {
    "STATEMENT" : "COUNT fileName" ,
    "CUSTOM_VARS" : "" ,
    "OUTPUT_FORMAT" : "MV"
  }
}

The OUTPUT_FORMAT in the template specifies how the result of the operation is returned, and can be MV, XML, XML_DICT, XML_JSCH, JSON, JSON_DICT, JSON_SCH

If the output format is MV, Linkar will convert the response to Base64. This prevents MV-specific delimiter characters in the XML payload from corrupting the XML structure.

XML and JSON Templates are available at GitHub to copy into code and modify.

As always, white-space is ignored in XML and JSON, and is provided here only for readability.

When using the Linkar REST API, the XML or JSON request payload also uses SendCommand Templates.