Try OpenEdge Now
skip to main content
Web Services
Creating ABL Clients to Consume OpenEdge SOAP Web Services : Invoking OpenEdge SOAP Web Service Operations from ABL : Invoking operations : Using a user-defined function
 
Using a user-defined function
For a user-defined function invocation, you must first forward reference a prototype mapped to the appropriate Web service procedure handle definition, exactly as you do for a remote user-defined function prototype mapped to a Web service proxy procedure handle.
This is the general syntax for the forward reference to a function prototype:

Syntax

FUNCTION operationName[ RETURNS ]dataType   
[ ( parameter[ , parameter ]... ) ]
  IN hPortType .
This statement invokes a Web service operation with the specified name (operationName) defined in the port type mapped to the specified procedure object handle (hPortType), passing any parameters with data types specified in the order they are defined for the operation by the WSDL Analyzer, and passing the operation return parameter with the corresponding data type (dataType).
This is the syntax for simple invocation of one user-defined function in a single statement, the same for both Web service operations and user-defined functions:

Syntax

return = operationName [ ( parameter[ , parameter]... ) ] .
This statement invokes a user-defined function with the specified name (operationName), passing any parameters with data types specified in the order they are defined for the operation by the WSDL Analyzer, and passing the operation return parameter as the value of the function, which is assigned to a variable of compatible data type. For an example of this syntax, see the sample WSDL Analyzer code in Figure 16.
As with any function, you can invoke it in any ABL statement where you need to use its value. However, you can only invoke a Web service user-defined function synchronously. For complete information on the FUNCTION statement prototype syntax, see OpenEdge Development: ABL Reference.