Overview


Web Function Declaration

Summary:

See also WSE Tutorial: Writing a Server and Client


Writing Web Services in BDL is very easy with the Genero Web Services Extension package. Users need only to create a classic BDL function and publish it as a Web Function with the function fgl_ws_server_publishFunction.  However, there is one restriction on the BDL function - neither input nor output parameters are allowed.

Input parameters 

Input parameters in BDL-Web-Functions are not allowed, but users can define one global variable or module variable per BDL-Web-Function, representing the input message of a Web-Function. This message must be a record in which each field represents one of the input parameters of the Web Function. Note: the name of each field corresponds to the name used in the SOAP request. These fields are filled with the contents of the SOAP request by the Web Services engine just before executing the corresponding BDL function.

Example:

01 DEFINE myfunction_in RECORD
02             input1 INTEGER,
03             input2 FLOAT
04          END RECORD
05	
06 FUNCTION myfunction()
07   DEFINE local INTEGER
08   ...
09   DISPLAY "Result: ",myfunction_in.input1,myfunction_in.input2
10   ...
11 END FUNCTION
 

Output Parameters

Output parameters in BDL-Web-Functions are not allowed, but users can define one global variable or module variable per BDL-Web-Function, representing the output message of  the function. This message must be a record where each field represents one of the output parameters of the Web Function.

Note: The name of each field corresponds to the name used in the SOAP request. These fields are retrieved from the Web Services engine immediately after executing the BDL function,  and sent back to the client.

Example:

01 DEFINE myfunction_out RECORD
02             output1 INTEGER,
03               output2 FLOAT
04          END RECORD
05
06 FUNCTION myfunction()
07   ...
08   LET myfunction_out.output1=10
09   LET myfunction_out.output2=5.5
10   ...
11 END FUNCTION