An exposed Fabric Web Service enables you to access specific data attributes stored in Fabric using input parameter/s and the relevant structured response like JSON, XML or CSV.
Fabric Studio supports defining a Web Service function, saving it to the project file and deploying it to the Fabric Server. A Web Service is a Java function.
The following steps discuss how a new Web Service is created and include options for generating parts of code automatically:
Go to Project Tree, right click Web Services > New Web Service to display the Function Editor window.
Click either the Objects or Database tab (left pane) and then either > DB Interface, Newest Reference File, or Newest LU File.
Select the preferred DB Connection. To access Fabric, select Newest LU Name. Note that for the newest file of an LU to be part of the DB Connections list, at least one LUI must be executed using the Data Viewer .
Click the DB File icon to display the Logical Unit Tables list.
Click the table that retrieves the data, check the Columns list and right click the column that is the Input parameter for data retrieval.
Click Add Selected to Input Parameters.
Note that the Column Name, Data Type, Mandatory and Comments are displayed in the Input Parameters list in the lower right pane.
Select the Column/s to be retrieved or press the CTRL key to select multiple columns. Right click and select Generate Code to automatically create the Select Statement and Basic Code Structure.
The generated code is displayed in the Java Editor window and includes the basic structure of the call to the interface or LUDB and the Fetch method. Note that you can also write your own code.
Once the code is generated, edit the function based on the logic to be applied. For example:
Db.Rows rows = ludb("Customer", <instanceID>).fetch(sql, <val1>, <val2>, ...);
Replace the <instanceID> placeholder with the input parameter CUSTOMER_ID.
Db.Rows rows = ludb("Customer", CUSTOMER_ID).fetch(sql);
Set the Web Service Properties in the upper right corner pane.
An exposed Fabric Web Service enables you to access specific data attributes stored in Fabric using input parameter/s and the relevant structured response like JSON, XML or CSV.
Fabric Studio supports defining a Web Service function, saving it to the project file and deploying it to the Fabric Server. A Web Service is a Java function.
The following steps discuss how a new Web Service is created and include options for generating parts of code automatically:
Go to Project Tree, right click Web Services > New Web Service to display the Function Editor window.
Click either the Objects or Database tab (left pane) and then either > DB Interface, Newest Reference File, or Newest LU File.
Select the preferred DB Connection. To access Fabric, select Newest LU Name. Note that for the newest file of an LU to be part of the DB Connections list, at least one LUI must be executed using the Data Viewer .
Click the DB File icon to display the Logical Unit Tables list.
Click the table that retrieves the data, check the Columns list and right click the column that is the Input parameter for data retrieval.
Click Add Selected to Input Parameters.
Note that the Column Name, Data Type, Mandatory and Comments are displayed in the Input Parameters list in the lower right pane.
Select the Column/s to be retrieved or press the CTRL key to select multiple columns. Right click and select Generate Code to automatically create the Select Statement and Basic Code Structure.
The generated code is displayed in the Java Editor window and includes the basic structure of the call to the interface or LUDB and the Fetch method. Note that you can also write your own code.
Once the code is generated, edit the function based on the logic to be applied. For example:
Db.Rows rows = ludb("Customer", <instanceID>).fetch(sql, <val1>, <val2>, ...);
Replace the <instanceID> placeholder with the input parameter CUSTOMER_ID.
Db.Rows rows = ludb("Customer", CUSTOMER_ID).fetch(sql);
Set the Web Service Properties in the upper right corner pane.