Try OpenEdge Now
skip to main content
Developing AppServer Applications
Programming the AppServer : Controlling AppServer entry points : Calling the EXPORT( ) method : Setting an initial export list
 
Setting an initial export list
The following code example shows how you might invoke the EXPORT( ) method from within an AppServer 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 an AppServer agent that executes this AppServer 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:
lReturn = SESSION:EXPORT("stocksys/*.p,acctpay/qry*.p,orders.pl<<*>>").
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 AppServer agent rejects a procedure for not being on this list, it returns an error to the client application.