Try OpenEdge Now
skip to main content
Open Client Introduction and Programming
Generating Proxies and Web Service Definitions : Example
 

Example

An OpenEdge developer at company ABCPets designs and develops an inventory system for pet shops, using the AppBuilder (.w files). These source files are in the directory c:\ABCPets\Source\Inventory. The files are compiled, and the r-code files are placed in c:\ABCPets\Bin\Inventory. ABCPets wants to package this functionality for Java clients. You run ProxyGen and supply the following information:
*AppObject NameInventory
*Propath Components c:\ABCPets\Bin
*Enable Unknowns for Parameter and Return Values — Selected
*Non-persistent ProceduresInventory\InvAdd.r
*Procedure Objects Inventory\p-Cust.r, set as type persistent, with the following internal procedures:
*AddInventory(), which takes two INTEGER parameters
*ValidateInventory()
*UpdateInternals(), which is defined in Inventory\p-Cust.r as PRIVATE
You customize the method definition for AddInventory() to disable the use of objects for passing the ABL Unknown value (?) in either parameter. You also explicitly exclude ValidateInventory(). Note that the internal procedure UpdateInternals() is defined with the PRIVATE keyword and does not appear in ProxyGen as a procedure to include or customize.
When you choose the Generate button, you supply the following information:
*AppServicecom.ABCPets.Inventory
*Packagecom.ABCPets
*Output Dirc:\Proxies
Proxy generation places the Java proxy (the .class files) into c:\Proxies\com\ABCPets, and creates the activity log as c:\Proxies\Inventory.log. The generated Java files include:
*Inventory.java
*Inventory.class
*InventoryImpl.class
*pCust.java (note the removal of the dash)
*pCust.class
*pCustImpl.class
You then change p-Cust.w but do not change the signature of AddInventory() (AddInventory(INTEGER, INTEGER)). Add new internal procedures to the persistent procedure p-Cust.w. These changes only require you to run ProxyGen to regenerate the proxy as long as you want them included. New non-PRIVATE internal procedures are added as methods automatically, with default definitions. To exclude them, you must run ProxyGen and customize the persistent procedure definition. Also, any changes in, or the removal of, ValidateInventory() do not cause validation errors because it is excluded from the proxy definition and it is not validated.
Run Batch ProxyGen as part of a regular build cycle, so any similar changes in ABL are picked up automatically.
Later in the development cycle, add a new procedure file for inventory, called Orders.w. This procedure file is saved in c:\ABCPets\Source\Inventory, and the r-code file is placed in c:\ABCPets\Bin\Inventory. Then run ProxyGen before the scheduled build and add this procedure file to the Inventory AppObject.
You make another change to the AddInventory() procedure, which now takes a third parameter (CHARACTER). Because this is a new parameter, it automatically gets the default (AppObject) setting to enable access to ABL Unknown value (?). If you want to disable access to the ABL Unknown value (?) by eliminating support for using objects as parameters, and instead using equivalent intrinsic types (where available in the language), you must run ProxyGen before the scheduled build and update the customizations for this procedure.