Is it possible to create a response without the outer response block and without opcOut which is a longchar? If I was working with a dataset I could user the "no outer block" option with write-json likewise I would not mind using a JSON Object and passing this as the response. I know I could use the new webspeed features to support REST but I wondered if it were possible with REST outside of webspeed?
Thanks in advance.
{
"response": {
"opcOut": {
"products": [
{
"Product": "1",
"Description": "Hello world!"
},
{
"Product": "100000",
"Description": "Chicken Nuggets (2 lb)"
},
becomes:
{
[
{
"Product": "1",
"Description": "Hello world!"
},
{
"Product": "100000",
"Description": "Chicken Nuggets (2 lb)"
}
]}
PROCEDURE action:
DEFINE INPUT PARAMETER ipcAction AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipcIn AS LONGCHAR NO-UNDO.
DEFINE OUTPUT PARAMETER opcOut AS LONGCHAR NO-UNDO.
DEFINE OUTPUT PARAMETER opiResponse AS INTEGER NO-UNDO INIT 200.
Hello,
Yes, it is possible using the REST URI Resource Editor.
You should be able to just map to the body of the response.
In that way, you would get the actual value of opcOut instead of the response object which is used when mapping to parameter.
See the following article for a screenshot showing how the mapping looks like:
community.progress.com/.../2190
I hope this helps.
Hello,
Yes, it is possible using the REST URI Resource Editor.
You should be able to just map to the body of the response.
In that way, you would get the actual value of opcOut instead of the response object which is used when mapping to parameter.
See the following article for a screenshot showing how the mapping looks like:
community.progress.com/.../2190
I hope this helps.
Many thanks I had not realised you could connect to the body rather than just below it. Many thanks.