Once we have some Dynamic Arrays created in LinkarServer they can be used through the Custom EndPoints in LinkarWS. Dynamic Arrays are made to be used in subroutine arguments. Dynamic Arrays have to be used along with special functions that are interpreted by LinkarServer and through which it is able to convert data from/to JSON or XML and MV buffers. These conversions are made to the subroutine arguments before the subroutine is called and after receiving its response.
Therefore, the purpose of Dynamic Arrays is converting data from JSON or XML to MV buffer and vice versa.
An example is shown in the image below in which a Custom Endpoint is using two Dynamic Array functions on the second and third subroutine arguments.
LK.JSON.PARSE.NONE.BF.LK.CUSTOMERS(%ESCAPED_LKARGS2%)
LK.JSON.NONE.BUILD.BF.LK.CUSTOMERS()
The first function, tied to the argument 2, indicates that a conversion will be made from/to JSON data (LK.JSON). Following it is .PARSE, which indicates the data has to be converted to an MV buffer before reaching the subroutine. After that no conversion will be made on the response MV buffer (.NONE). Finally the identifier BF.LK.COSTUMERS dictates which Dynamic Array will be used for the conversion.The Dynamic Array's definition controls which JSON key is tied to which MV attribute, thus building the MV buffer that will reach the subroutine.
The second function, tied to argument 3, indicates that a conversion will be made from/to JSON data (LK.JSON) but no conversion will be made (.NONE) before sending the data to the subroutine. Finally the returning MV buffer from the subroutine response's argument 3 will be converted (.BUILD) to a JSON record, using the Dynamis Array identified as BF.LK.COSTUMERS for the conversion protocol.
