Call statement

The call statement has two current uses: to invoke a service asynchronously from a Rich UI application; or to call a program on IBM i.

You typically work with the call statement as you do with any of the other action statements such as add or get:

  1. Declare a binding variable to hold the access detail. Here is an example for code that accesses a service:
    myBindingDetail IHTTP {@Resource{uri="binding:myBinding"}};
    You might assign the access detail in one of two ways:
    • By referencing a resource binding that resides in an EGL deployment descriptor, as is true in the current example; or
    • By specifying the necessary detail in your code.
  2. When you code the action statement, reference the binding variable in the using clause. Here is a call statement that references the myBindingDetail variable:
    call myProxyFunction.myOperation() 
       using myBindingDetail
       returning to myCallbackFunction
       onException myExceptionHandler;
The following topics include the details necessary to use the call statement for one or another purpose: