Creating server-side context for a ProcObject (running a persistent procedure)
Print
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
You create the server-side context for the ProcObject as shown below.
To create the context for a ProcObject on the AppServer:
-
Run the persistent procedure, creating the ProcObject:
orderInfo.createPO_CustomerOrder(3);CAUTION: Now that the ProcObject is created, remember to release the object later when it is no longer needed. -
Check to see if an object ID was returned:
if (null == orderInfoControlBlock.getObjectNameID("CustomerOrder")) { throw new Exception("No header returned from a create operation for CustomerOrder."); } -
The
CustomerOrderObjStubobject is created from a factory method included in theOrderInfoObjStubobject. Therefore, thePscObjectIDHandlerbound to theOrderInfoObjStublocates and stores the object ID value for theCustomerOrderObjStubobject in theOrderInfoObjStubobject. Thus the client application must obtain (export) the object ID value for theCustomerOrderObjStubfrom theOrderInfoObjStubhandler and insert (import) it into theCustomerOrderObjStubhandler. For example:custOrderControlBlock.importObjectID("CustomerOrder", orderInfoControlBlock.exportObjectID("CustomerOrder"));This enables the
CustomerOrderObjStubhandler to automatically insert theCustomerOrderobject ID into the headers for all SOAP requests made on theCustomerOrderObjStubobject. -
The client application must then remove (release) the object ID value for the
CustomerOrderObjStubobject from theOrderInfoObjStubhandler because it is no longer needed by that handler. For example:orderInfoControlBlock.releaseObjectNameID("CustomerOrder");