Client side

If a SOAP fault occured the operation returns the SOAP fault number in the operation status. The SOAP fault number is defined in the generated stubs as a 4GL constant prefixed with the string FaultID_.

For example in $FGLDIR/demo/WebServices/calculator/client/ws_calculator.inc, Divide operation has a SOAP fault that informs the client when a number is divided by zero.
# List of Soap fault constants
CONSTANT FaultID_DividedByZero = 1
...
# VARIABLE : DividedByZero
DEFINE DividedByZero STRING ATTRIBUTE(XMLName="DividedByZero",
  XMLNamespace="http://tempuri.org/")
...
# Operation: Divide
# FAULT #1: GLOBALS DividedByZero

You can test the operation status code accordingly and display the SOAP fault message.

For example in $FGLDIR/demo/WebServices/calculator/client/calculatorClient.4gl, when the divide operation status is 1, DividedByZero message is displayed.
ON ACTION divide
   CALL Divide(op1, op2) RETURNING wsstatus, result, remaind
   CASE wsstatus
      WHEN 0
         DISPLAY BY NAME result,remaind
         DISPLAY "OK" TO msg
      WHEN FaultID_DividedByZero
         DISPLAY DividedByZero TO msg
      OTHERWISE
         DISPLAY wsError.description TO msg
   END CASE