REST service - Node editing

Posted by Tony on 09-Jun-2014 18:10

Is it possible to override the 'Expression Value" via the node editor dialog box, or any other means?

The expression value always seems to be prefixed 'request'.

With the Sonic workbench this was achieved by setting a parameter value in the service properties file.

Posted by Michael Jacobs on 11-Jun-2014 04:58

Hi Tony,

The process that generates the WAR file creates & inserts a REST service description file with a .paar file extension in the WEB-INF/adapter/<rest-service-name>/.    It is a ZIP archive with all the service's information the run-time requires and in it you can view all of the mapping from http to the AppServer client.

For my information would you elaborate on the use case where manually editing the mapping expression solves your problem?   Thanks.

In any case - there is an ideas location in communities where you can suggest improvements in the product.   This would be a good addition.

All Replies

Posted by Michael Jacobs on 10-Jun-2014 04:41

Tony,

I do not believe that the expression is editable in REST.   However it is correct because you mapped the input parameter to a parameter within the 'body', which requires an outer "request" json object as a container that holds multiple individual parameters.   With single input or output parameter the recommendation is to map it to the 'body' and not to the 'drop a parameter here...].   When you map directly to the body the expression should not have the "request" json object wrapper.

A subtle distinction in the use of the GUI mapper.

Posted by Tony on 11-Jun-2014 03:27

Michael,

Thanks for the clarificaion. Mapping the body to the ABL input parameter does pass the payload through.

Find it very dissapointing that Progress put such a huge restriction on what could have been an extremely useful developement tool.

Is there an source file generated by the GUI mapper that could potentially be edited to my needs?

Posted by Michael Jacobs on 11-Jun-2014 04:58

Hi Tony,

The process that generates the WAR file creates & inserts a REST service description file with a .paar file extension in the WEB-INF/adapter/<rest-service-name>/.    It is a ZIP archive with all the service's information the run-time requires and in it you can view all of the mapping from http to the AppServer client.

For my information would you elaborate on the use case where manually editing the mapping expression solves your problem?   Thanks.

In any case - there is an ideas location in communities where you can suggest improvements in the product.   This would be a good addition.

Posted by Tony on 11-Jun-2014 17:17

Hi Michael,

I need to create a REST service to recieve messages from a third party, that we then update our OE app as needed. The message payload is JSON with multiple parameters. The issue I have is that this third party is not able(willing) to change their JSON output to have this outer "request" object.

I am hoping that after I make the mappings with the GUI, your suggestion to edit the file will achieve the results I need.

I'll let you know and I'll post the product improvement idea.

Posted by Tony on 12-Jun-2014 03:06

Hi Michael,

Your suggestion did the trick. Adds overhead to the dev/deploy cycle, but it does work.

I should know submit the change request to the "Ideas" forum.

Thanks again for your help Michael.

This thread is closed