Generate GWS client stub files from the WSDL (legacy)

Use the fglwsdl tool to generate legacy client stub files (.inc and .4gl) compatible with apps created with Genero 3.20 or prior.

This example command requests the Web service information for the "MyCalculator" service. The fglwsdl -legacy option specifies to generate legacy code, and the output files (.inc and .4gl) will have the base name "ws_calculator".
fglwsdl -soap12 -legacy -o ws_calculator http://localhost:8090/Calculator?WSDL
The "MyCalculator" GWS service must be running on the specified port in order to provide the WSDL information.
This generates two files:
  • ws_calculator.inc - the globals file containing the definitions of the input and output records, and the prototypes of the operations.
  • ws_calculator.4gl - a module containing prototype definitions of the functions that can be used in your GWS client application to perform the requested Web Service operation, and the code that manages the Web Service request.

Input and Output records

The globals file contains record definitions for the data types of the operations obtained from the WSDL. They are defined as variables within the GLOBALS instruction.
GLOBALS 
#...
DEFINE Add RECORD 
  ATTRIBUTES( XMLName="Add", 
             XMLNamespace="http://tempuri.org/webservices" )
  a INTEGER ATTRIBUTES( XMLName="a", XMLNamespace="" ),
  b INTEGER ATTRIBUTES( XMLName="b", XMLNamespace="" )
END RECORD

DEFINE AddResponse RECORD 
  ATTRIBUTES( XMLName="AddResponse", 
             XMLNamespace="http://tempuri.org/webservices" )
  r INTEGER ATTRIBUTES(XMLName="r",XMLNamespace="" )
END RECORD

#...
END GLOBALS

Function prototypes for the operations

The globals file contains prototypes for the generated functions for each operation. For example, the Add operation has two functions that developers may use for different situations and data types.

The Add function uses input and output parameters, and returns the status and result. This function can only be used if the input and output parameters are not complex structures such as arrays or records. Using this function, developers do not access the global records directly.

The Add_g function can be used with the global input and output records. Before calling this function, you must set the values in the variables of the global input record.

Operation: Add
#
# FUNCTION: Add_g()
#   RETURNING: soapStatus
#   INPUT: GLOBAL Add
#   OUTPUT: GLOBAL AddResponse
#
# FUNCTION: Add(p_a, p_b)
#   RETURNING: soapStatus ,p_r

For examples using the functions, see Call the web service.