fgl_ws_server_getFault() (version 1.3)

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 valid for backwards compatibility, but is not a preferred way to handle Genero Web Services. See the com package for the preferred classes and methods for handling Web services.

Syntax

fgl_ws_server_getFault()
  RETURNS STRING

Usage

The function returns a string containing the SOAP fault string.

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

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