S
Srinivas Munigala
Guest
You can't map each field of the temp-table to each parameter. Here, your input temp-table (i.e. tt) is an object and it can be mapped to a single path or query parameter (as shown in attachment). And you need to pass the field values in json format as I mentioned earlier. From: Stefan Drissen [mailto:bounce-14941@community.progress.com] Sent: Thursday, September 25, 2014 12:57 AM To: TU.OE.Development@community.progress.com Subject: RE: [Technical Users - OE Development] REST input to temp-table? RE: REST input to temp-table? Reply by Stefan Drissen Hi Srinivas, Does the rest expose editor give any user interface clue that you can do this? I only see that there is an input temp-table. I can see this working for the query string parameters, but how do I indicate which temp-table field needs to be mapped in the path parameters? A quick test with the following .p @openapi.openedge.export FILE(type="REST", executionMode="single-run", useReturnValue="false", writeDataSetBeforeImage="false"). DEFINE TEMP-TABLE tt NO-UNDO FIELD adm_nr AS INTEGER FIELD debtor AS INTEGER FIELD country AS CHARACTER INDEX ttix IS UNIQUE PRIMARY adm_nr debtor. @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false"). PROCEDURE lala: DEFINE INPUT PARAMETER TABLE FOR tt. FIND FIRST tt NO-ERROR. IF AVAILABLE tt THEN MESSAGE tt.adm_nr tt.debtor. ELSE MESSAGE "tt not available". END PROCEDURE. With path mapping defined as: tt/{adm_nr}/{debtor} With both path parameters mapped to interface parameter 'tt' results in errors in the AppServer log: Error parsing JSON: unexpected token: eof. (15360) Error attempting to run 'lala tt.p'. JSON value of ProDataset or temp-table parameter is invalid or empty. (16992) An incomplete client request. (8020) Stop receiving emails on this subject. Flag this post as spam/abuse.
Continue reading...
Continue reading...