fgl_ws_server_getFault() (version 1.3)

Purpose

This function retrieves the last fault string the user has set in a Web-Function, or an empty string if there is none.

Note: This function is only for testing the Web Services functions before they are published on the Web.

Syntax

FUNCTION fgl_ws_server_getFault()
  RETURNING faultMessage VARCHAR

Parameters

Return values

Example

 DEFINE div_input RECORD
			a INTEGER,
			b INTEGER
			END RECORD

 DEFINE div_output RECORD
			result INTEGER
			END RECORD

 FUNCTION TestServices()
    DEFINE string VARCHAR(100)
    ...
    # Test divide by zero operation
    LET div_input.a=15
    LET div_input.b=0
    CALL service_operation_div()
    LET string=fgl_ws_server_getFault()
    DISPLAY "Operation div error: ", string
    ...
 END FUNCTION

 FUNCTION service_operation_div()
    ...
    IF div_input.b = 0 THEN
      CALL fgl_ws_server_setFault("Divide by zero")
      RETURN
    END IF
    ...
 END FUNCTION