Step 2: Write a BDL function for your service operation

Write functions that implement the functions in the stub file. This allows you to create your own version of the function.

Using the information from the files generated in Get the WSDL description and generate legacy files, the Add operation from Example 1: Writing the entire server application is rewritten to have different functionality but to still be compatible with the WSDL description of the operation.

This step accomplishes the same thing as Step 2: Write a BDL function for each service operation in Example 1. In this version of the add operation, the sum of the two numbers in the input record is increased by 100.

# my_function.4gl                         -- file containing the function 
                                          -- definition
IMPORT com                                -- import the Web Services library
IMPORT FGL example1Service                -- import the generated service file

#User Public Functions
FUNCTION add()                            -- new version of the add function
                                          -- the public input and output records are used
LET example1Service.AddResponse.r = (example1Service.Add.a + example1Service.Add.b)+ 100  
                                         
END FUNCTION