The following code example shows how you might invoke the EXPORT( ) method from within a PAS for OpenEdge Connect procedure. In this example, two procedures, order.p and stock.p, are added to the export list, as shown:
DEFINE INPUT PARAMETER cUserId AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER cPassword AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER cAppServerInfo AS CHARACTER NO-UNDO.
DEFINE VARIABLE lReturn AS LOGICAL.
/* Authenticate user and call EXPORT appropriately for this user. */
. . .
ASSIGN lReturn = SESSION:EXPORT("order.p,stock.p").
When this code executes, it adds the two procedures to the export list. A remote procedure request to a server session that executes this PAS for OpenEdge Connect procedure executes itself only if the request is for order.p or stock.p. Otherwise, the remote procedure request returns an error.
Export list entries can also include names with an asterisk (*). The asterisk is a wildcard character to indicate that any group of characters is acceptable as a replacement for the asterisk.
For example, you can reference all procedures in a directory such as stocksys/*.p, some procedures in a directory such as acctpay/qry*.p, or all procedures in a library such as order.pl<<*>>, as shown:
After this code executes, all procedures located in the stocksys directory, some procedures located in the acctpay directory, and all procedures located in the orders procedure library are added to the export list.
If you create an export list, keep in mind that a client application is unaware that the procedures that it is submitting are being validated against this list. When the server session rejects a procedure for not being on this list, it returns an error to the client application.