Mobile Rest Invoke Method Unable to receive inputs

Posted by MarkT on 18-Apr-2015 07:36

Hi All,

I've added an invoke method in the hope of being able to call it from Rollbase eventually - I've been trying from postman as well as from rollbase using the sendJSONrequest function.  The problem I am getting is I don't seem able to get the openedge method to receive any inputs.  In the example below filter always returns ? no matter what I put into postman or the sendJSONrequest function.

@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resourceMapping(type="REST", operation="invoke", URI="/StartLoad", alias="", mediaType="application/json").
METHOD PUBLIC VOID StartLoad(INPUT filter AS CHARACTER,
                                                               INPUT qryPos AS INTEGER,
                                                               OUTPUT DATASET dsBatch):
  MESSAGE "i ran! filter is: " filter VIEW-AS ALERT-BOX.
END METHOD.

What should I be sending with Postman or Rollbase sendJSONrequest to get the inputs populated?  I've tried many different variations of parameter all with no luck, I always send a type of "PUT" - anyone know where I might be going wrong?

Thanks,

Mark

Posted by egarcia on 21-Apr-2015 11:00

Hello Mark,

To pass input parameters to an invoke operation, you need to use a request object as the request payload.

Here is an example on how it would look like:

   {"request":{"filter":"", qryPos: 20}}

Just in case, here is an example that uses it:

   oemobiledemo.progress.com/.../example015.html

For this example, the request payload looks like the following:

   {"request":{"piYear":2014}}

I hope this helps.

All Replies

Posted by bheavican on 21-Apr-2015 09:50

Has anyone else got this to work?

Posted by egarcia on 21-Apr-2015 11:00

Hello Mark,

To pass input parameters to an invoke operation, you need to use a request object as the request payload.

Here is an example on how it would look like:

   {"request":{"filter":"", qryPos: 20}}

Just in case, here is an example that uses it:

   oemobiledemo.progress.com/.../example015.html

For this example, the request payload looks like the following:

   {"request":{"piYear":2014}}

I hope this helps.

Posted by egarcia on 21-Apr-2015 11:05

Hello,

Just in case, here is the link to the documentation on passing parameters to a method:

   documentation.progress.com/.../openedge115

Regards.

Posted by MarkT on 22-Apr-2015 07:59

Thanks a lot for that, it works perfectly!

This thread is closed