Write the MAIN program code block

Import the client stub, and call its functions.

To call a REST service function, in your client's main module, you:
  1. Import the client stub module
  2. Call the functions within the MAIN program block
IMPORT FGL clientStub
MAIN
  DEFINE wsstatus INTEGER
  DEFINE retI     INTEGER
  
  CALL clientStub.Add(3,5) RETURNING wsstatus, retI
  IF wsstatus == clientStub.C_SUCCESS THEN
    DISPLAY "Add result is :",retI
  ELSE
    DISPLAY "Error in add"
  END IF
 
END MAIN

This example is a very basic version of the code. For complete examples, see the code samples provided with the package in demo/WebServices.