In addition to Brian's option...
[AD] I think Linkar can help you in your task. Linkar provides structured json results. and allows you to save to database using json as data source.
As an example let's execute a read of a record from any environment, be it .net, java, php, nodejs, Rest api, ...
Linkar can return the result in different formats. In Json there are three output possibilities, depending on the desired level of complexity and the quality of your dictionaries:
1.-
JSON output format. This is the basic format. As you will see in the example, attributes that have multivalues are returned as a string.
{
"TOTAL_RECORDS": "1",
"RECORDS": [
{
"LKITEMID": "2",
"CUSTOMER": "14",
"DATE": "17218",
"ITEM": "101885ý101102ý101894",
"QTY": "402ý451ý837",
"PRICE": "874.18ý50.62ý127.67",
"DELIVERYDATE": "ý17269ü17351ý",
"QTYPARTIAL": "ý225ü226ý",
"ICUSTOMERNAME": "CUSTOMER 14",
"IITEMDESCRIPTION": "SCREW 101885ýPLUG 101102ýSCREW 101894",
"IITEMSTOCK": "232ý41ý847",
"ITOTALLINE": "351420.36ý22829.62ý106859.79",
"ITOTALORDER": "481109.77"
}
],
"ERRORS": []
}
2.-
JSON_DICT output format. In this format arrays of multivalue attributes are created. You have to use in your dictionaries the field 4 of structure: c;attr#;attr#;... d;attr#
{
"TOTAL_RECORDS": "1",
"RECORDS": [
{
"LKITEMID": "2",
"CUSTOMER": "14",
"DATE": "17218",
"LstItems": [
{
"ITEM": "101885",
"QTY": "402",
"PRICE": "874.18",
"DELIVERYDATE": "",
"QTYPARTIAL": "",
"IITEMDESCRIPTION": "SCREW 101885",
"IITEMSTOCK": "232",
"ITOTALLINE": "351420.36"
},
{
"ITEM": "101102",
"QTY": "451",
"PRICE": "50.62",
"DELIVERYDATE": "17269ü17351",
"QTYPARTIAL": "225ü226",
"IITEMDESCRIPTION": "PLUG 101102",
"IITEMSTOCK": "41",
"ITOTALLINE": "22829.62"
},
{
"ITEM": "101894",
"QTY": "837",
"PRICE": "127.67",
"DELIVERYDATE": "",
"QTYPARTIAL": "",
"IITEMDESCRIPTION": "SCREW 101894",
"IITEMSTOCK": "847",
"ITOTALLINE": "106859.79"
}
],
"ICUSTOMERNAME": "CUSTOMER 14",
"ITOTALORDER": "481109.77"
}
],
"ERRORS": []
}
3.-
JSON_SCH output format. This format allows you to exploit also the subvalues. To do so, you must define your schema in Linkar Schemas.
{
"TOTAL_RECORDS": "1",
"RECORDS": [
{
"LKITEMID": "2",
"CUSTOMER": "14",
"DATE": "17218",
"MvItems": [
{
"ITEM": "101885",
"QTY": "402",
"PRICE": "874.18",
"SvDeliveryDates": [
{
"DELIVERYDATE": "",
"QTYPARTIAL": ""
}
],
"IITEMDESCRIPTION": "SCREW 101885",
"IITEMSTOCK": "232",
"ITOTALLINE": "351420.36"
},
{
"ITEM": "101102",
"QTY": "451",
"PRICE": "50.62",
"SvDeliveryDates": [
{
"DELIVERYDATE": "17269",
"QTYPARTIAL": "225"
},
{
"DELIVERYDATE": "17351",
"QTYPARTIAL": "226"
}
],
"IITEMDESCRIPTION": "PLUG 101102",
"IITEMSTOCK": "41",
"ITOTALLINE": "22829.62"
},
{
"ITEM": "101894",
"QTY": "837",
"PRICE": "127.67",
"SvDeliveryDates": [
{
"DELIVERYDATE": "",
"QTYPARTIAL": ""
}
],
"IITEMDESCRIPTION": "SCREW 101894",
"IITEMSTOCK": "847",
"ITOTALLINE": "106859.79"
}
],
"ICUSTOMERNAME": "CUSTOMER 14",
"ITOTALORDER": "481109.77"
}
],
"ERRORS": []
}
These tests I have done with a utility called Linkar Tester, once Linkar is installed and configured you can test all the functions.
And if you download Linkar Trainer, in addition to making these same tests, you can see the source code in different environments used to execute the operation,
for example the read used as an example is programmed with the following code
1.-
with .NET using Linkar;
using Linkar.Functions.Direct.JSON;
class Test {
public string MyRead()
{
string result = "";
try{
CredentialOptions credentials = new CredentialOptions("192.168.100.100", "MyEntryPoint", 11300, "myuser", "mypass");
result = Functions.Read(credentials, "LK.ORDERS","{ \"RECORDS\": [ { \"LKITEMID\": \"2\" } ]}", "",null, JSON_FORMAT.JSON_DICT);
}
catch (Exception ex)
{
string error = ex.Message;
// Do something
}
return result;
}
}
2.-
with java import linkar.*;
import linkar.functions.*;
import linkar.functions.direct.json.*;
public class Test {
public String MyRead()
{
String result = "";
try{
CredentialOptions credentials = new CredentialOptions("192.168.100.100", "MyEntryPoint", 11300, "myuser", "mypass");
result = Functions.Read(credentials, "LK.ORDERS","{ \"RECORDS\": [ { \"LKITEMID\": \"2\" } ]}", "",null, JSON_FORMAT.JSON_DICT);
}
catch (Exception ex)
{
String error = ex.getMessage();
// Do something
}
return result;
}
}
3.-
with php include_once 'Linkar/Linkar.php';
include_once 'Linkar.Functions.Persistent.JSON/Functions.php';
public function MyRead()
{
$credentials = new CredentialOptions("192.168.100.100", "QMWINQ", 11300, "admin", "1234");
$result = DirectCommands::Read($credentials, "LK.ORDERS","{ \"RECORDS\": [ { \"LKITEMID\": \"2\" } ]}", "",null, JSON_FORMAT.JSON_DICT);
return $result;
}
4.-
also with VB, Node JS, Python... And finally, we can use
Linkar REST API to make REST calls. The call
using curl would be:
curl -X 'POST' \
'
http://192.168.100.100:11201/api/Read' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"APIKEY": "myapikey",
"DATA": {
"FILE_NAME": "LK.ORDERS",
"RECORDS": [
{
"LKITEMID": "2"
}
],
"DICT_CLAUSE": "",
"CALCULATED": "False",
"CONVERSION": "False",
"FORMAT_SPEC": "False",
"ORIGINAL_RECORDS": "False",
"CUSTOM_VARS": "",
"OUTPUT_FORMAT": "JSON"
},
"LANGUAGE": "",
"FREETEXT": ""
}'
You can test this from the Swagger that you have in Linkar Manager. And we will soon be launching Linkar Web Services, a professional API that implements OpenID and OAuth 2.0 standards, providing a comprehensive solution for user authentication and authorization in the API.
As you can see there are multiple connection options to your D3 machine. And the price is not prohibitive.
Anything you know...
Angel