Script


The Script policy can be added in 4 zones in which the Apinizer platform is managed. With this policy, the header, parameter and body contents in the messages can be operated with the selected script language. The following is an example of the Script policy that will be executed on the Request Message From The Client to the Gateway.

  • The fields in the Script window to be executed on the request message from the client to the gate are entered. A description of these areas is given below.
    • Name:If the global policy is added, the name of the policy is entered.
    • Description:If global policy is added, a description can be entered to make policy selections easier.
    • Script Dili: Script dili seçilir.
    • Script Language: The script language is selected.
    • Test Script: The script to be executed on the request message is written
  • Click Save button to save the operation.

Figure: Script policy

  • When the Test Script link is clicked, the values for the entries to be used by the script are created over the Test Script window. These values can be changed during script operation. Descriptions of the fields in this window are listed below.
    • Headers:The name of the header is entered in the Name field, the value of the title is entered in the Value field. Clicking the Add button will generate the title entry. Click the Delete button to delete the current header entry.
    • Parameters: The name of the parameter is entered in the Name field, the value of the parameter is entered in the Value field. Clicking the Add button will generate the parameter input. Click the Delete button to delete the current parameter entry.
    • Body: In this input field, the body of the message is written.
    • Script: Script will be written with the selected script language.
    • Execute Script: Clicking on this link will open the script and open the window with input and output information.

Figure: Test Script Window

  • Clicking the link opens the Test Result is displayed using the input values are generated by the Script. Descriptions of the fields in this window are listed below.

    • Elapsed time: The test period is displayed.
    • Script result: The script result in the test result is displayed.
    • Input;
      • Headers: The message headers information is displayed.
      • Parameters: Entered message parameters information is displayed.
      • Body: The information of the entered message body is displayed.
    • Output;
      • Headers: The script value generated with the entered header information is displayed.
      • Parameters: The script value generated with the entered parameter information is displayed.
      • Body: The script value produced with the entered body information is displayed

Figure: Execute Script window