Hello,
in the rest resource uri editor (using a Rest service project in dev studio) is there a way to automatically do the mapping in mapping definitions instead of drag/drop every parameter? For example to automatically map output parameters to response body parameters (to get a json response).
With webservices one can manually edit the xpxg files and compile them, how do one do the same with rest services (what files and where are they located)?
We are using OE 11.3.2, but if there is a better solution in a later version please let us know.
Hello,
in the rest resource uri editor (using a Rest service project in dev studio) is there a way to automatically do the mapping in mapping definitions instead of drag/drop every parameter? For example to automatically map output parameters to response body parameters
(to get a json response).
With webservices one can manually edit the xpxg files and compile them, how do one do the same with rest services (what files and where are they located)?
We are using OE 11.3.2, but if there is a better solution in a later version please let us know.
Flag this post as spam/abuse.
Hello,
in the rest resource uri editor (using a Rest service project in dev studio) is there a way to automatically do the mapping in mapping definitions instead of drag/drop every parameter? For example to automatically map output parameters to response body parameters
(to get a json response).
With webservices one can manually edit the xpxg files and compile them, how do one do the same with rest services (what files and where are they located)?
We are using OE 11.3.2, but if there is a better solution in a later version please let us know.
Flag this post as spam/abuse.
Flag this post as spam/abuse.
WinningJr: Thanks for your reply,
unfortunate we have preexisting webservices we would like to also add as rest services. These procedures dont use temp-tables but have alot of input/output parameters.
Ramadevi Dhavala: Ok, can we edit the generated files directly (like the xpxg files for webservices)? If so, which ones? Also will you add the ability to remove the temp-table name (like when using write-json omit-outer-object)?
Hi Stefan,
Take a look at the annotations we use for REST services for the JSDO. The annotations provide some customizations but the majority of the mapping is done using defaults based on the signature of the method/procedure. There are less options for mapping (only body or query parameter) but you can avoid the mapper and just automate the generation of the annotations to the source files of your REST service.
Thanks
-Shelley
Shelly Chase: I am not familiar with JSDO and couldn't find any examples on how to annotate an existing .p-file in a way that removed the need to use REST Resource uri editor. Can you please add an URL to an example?
If I understand the question correct: you don't need to be familiar wirh the jsdo for this. Just define a service interface with pds for your .p and take the generated annotations as example for your own codegenerator. It shouldn't be that difficult.
agent_008_nl: Using "define service interface" on the .p-file only created the @openapi.openedge.export line and no mappings. Also I don't understand how to take the annotated .p-file and generate the .pidl-file (with supplied tools).
Basically we don't want to make our own code generator, we have a number of preexisting .p-files (which we already have deployed as web services) and want to generate appropriate .pidl-files (with default mapping), preferably without having to use drag/drop. Much like having a .xpxg-file and generating the .wsm-file when creating a web service.
Forgot to mention my name, Stefan Houtzager it is. Strange. I'm on 11.5 and see f.e. the code below after defining the serviceinteface (rightmouse click in pds, above the code-editor choose "progress openedge" and then "define service interface". For the rest I cannot help you, sorry. Your wish looks fair to me, I had a comparable one: community.progress.com/.../18051.aspx
Regards, Stefan.
@openapi.openedge.export FILE(type="REST", executionMode="singleton", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resource FILE(name="custom", URI="/custom", schemaName="dsPurchaseOrder", schemaFile="").
/*------------------------------------------------------------------------
File : custom.p
Purpose :
Syntax :
Description :
Author(s) :
Created : Wed May 20 12:12:59 CEST 2015
Notes :
----------------------------------------------------------------------*/
BLOCK-LEVEL ON ERROR UNDO, THROW.
{"dsPurchaseOrder.i"}
{"dsFetchRequest.i"}
/* *************************** Definitions ************************** */
@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json").
procedure ReaddsPurchaseOrder:
define INPUT parameter filter AS CHARACTER no-undo.
define OUTPUT parameter DATASET for dsPurchaseOrder.
END procedure.
Stefan Houtzager: Thanks for your reply, unfortunately we are using OE 11.3.2, however we are looking into upgrading to 11.5. Indeed more automation would be preferable when having large amount of preexisting files.
Hi Everyone,
Do we have any option to map the customized header parameter from the Rest URL in rest adapter?
I have given the Key as "Sourcesystem" and the value is "XYZ", Now i want to get into internal procedure and how to map this in rest adapter.
Your help much appreciated.
Thanks,
Sivarami Reddy