The code in an automatically generated Web Service function provides basic Select and Fetch templates for data retrieval. However, there is frequently a need to enhance a function’s code in order to perform a specific functionality.
It is recommended to edit the code in a Web Service function using the IntelliJ Java Editor which offers a number of advantages like:
Smart code completion.
Inspection and quick fixes.
Functions.
Navigation and Search options.
Note that IntelliJ is not part of the Fabric Studio Installation Package and must be installed. Once installed, it is integrated into the Fabric Studio and can be invoked by right clicking the Web Service working area and selecting it or by pressing CTTL+I on your keyboard.
A Web Service can also be edited directly in its main working area.
The following items should be edited after they are automatically generated:
Item |
Description |
Fetch Data Statement |
LUDB Fetch Statement. Replace this with the Web Service Input parameter defined as the Fabric LUI identifier. For example, in the wsCustomerInfo Web Service:
Either populate the SQL query parameters in their placeholders (, ,…) or delete them if they are not required. These steps are mandatory for a clean Web Service code compilation. For example:
|
SQL Statement Enhancement Options |
For example, assigning identifiers to tables and specifying which table columns to retrieve. |
Java Code Enhancement |
Web Service code can also apply transformation rules via the functions, translations or Globals defined in the project. Note that any Fabric server runtime command can be used within the Web Service using the Execute function. For example, the Get command on the Customer LUT for a specific instance: Fabric().execute(“ get Customer.?”,ID); |
Custom Payload Handling |
When required, handle the service request body manually. |
The code in an automatically generated Web Service function provides basic Select and Fetch templates for data retrieval. However, there is frequently a need to enhance a function’s code in order to perform a specific functionality.
It is recommended to edit the code in a Web Service function using the IntelliJ Java Editor which offers a number of advantages like:
Smart code completion.
Inspection and quick fixes.
Functions.
Navigation and Search options.
Note that IntelliJ is not part of the Fabric Studio Installation Package and must be installed. Once installed, it is integrated into the Fabric Studio and can be invoked by right clicking the Web Service working area and selecting it or by pressing CTTL+I on your keyboard.
A Web Service can also be edited directly in its main working area.
The following items should be edited after they are automatically generated:
Item |
Description |
Fetch Data Statement |
LUDB Fetch Statement. Replace this with the Web Service Input parameter defined as the Fabric LUI identifier. For example, in the wsCustomerInfo Web Service:
Either populate the SQL query parameters in their placeholders (, ,…) or delete them if they are not required. These steps are mandatory for a clean Web Service code compilation. For example:
|
SQL Statement Enhancement Options |
For example, assigning identifiers to tables and specifying which table columns to retrieve. |
Java Code Enhancement |
Web Service code can also apply transformation rules via the functions, translations or Globals defined in the project. Note that any Fabric server runtime command can be used within the Web Service using the Execute function. For example, the Get command on the Customer LUT for a specific instance: Fabric().execute(“ get Customer.?”,ID); |
Custom Payload Handling |
When required, handle the service request body manually. |