0

Web Services Framework - Advanced Topics

1. Onstart Logicnets

When you want your application to perform common initialization tasks when it starts, you can create and put those logicnets in the onstart folder of your project. You can put as many logicnets as you want in this folder, and the system will execute them in the order they appear in the folder.

The logicnets the system calls in the onstart folder have access to the same context as the end-point logicnets, so they can access the __in and __out data-objects to retrieve input data or to write data to the output data objects. 

2. Custom Input and Output Data Conversion

You can specify custom input and output data convertors; for example, to support custom data formats or to perform data validation on the input data. You specify your data convertors in the Framework settings tab.

Note: If you specify a data convertor, the system bypasses the standard framework data convertor. This means that you will have to perform data conversion for all the data formats that you want to support. You can use the information from the ‘request_info’ to determine the data format of the input data.
 

Data convertors have access to the same context as the end-point logicnets, so they can access the __in and __out data-objects to retrieve input data or to write data to the output data objects.

3. Logging Inbound Calls

For troubleshooting, set log_inbound_ws_calls = 1 in the _session section of the company settings.cfg. The framework then writes one log file per call to dat\bnt\<company>\log\ (<session>_webservice_<METHOD>_<endpoint>_<timestamp>.log) with the request and the response.

The system writes passwords, secrets, API keys, and tokens in the request and response as ********, but the client still receives the real response. To mask such values yourself, for example before you write them to your own log or database, use the Mask sensitive data part.

Reply

null

Content aside

  • 5 yrs agoLast active
  • 43Views
  • 2 Following