Creating server-side context for a ProcObject (running a persistent procedure)
You create the server-side context for the ProcObject as shown below.
To create the context for a ProcObject on the AppServer:
1. 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.
2. 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.");
}
3. The CustomerOrderObjStub object is created from a factory method included in the OrderInfoObjStub object. Therefore, the PscObjectIDHandler bound to the OrderInfoObjStub locates and stores the object ID value for the CustomerOrderObjStub object in the OrderInfoObjStub object. Thus the client application must obtain (export) the object ID value for the CustomerOrderObjStub from the OrderInfoObjStub handler and insert (import) it into the CustomerOrderObjStub handler. For example:
This enables the CustomerOrderObjStub handler to automatically insert the CustomerOrder object ID into the headers for all SOAP requests made on the CustomerOrderObjStub object.
4. The client application must then remove (release) the object ID value for the CustomerOrderObjStub object from the OrderInfoObjStub handler because it is no longer needed by that handler. For example: