Mobile Rest Invoke Method Unable to receive inputs - Forum - Community Groups - Progress Community

Mobile Rest Invoke Method Unable to receive inputs

 Forum

Mobile Rest Invoke Method Unable to receive inputs

This question is answered

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

Verified Answer
  • 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
  • Has anyone else got this to work?

  • 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.

  • Hello,

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

       documentation.progress.com/.../openedge115

    Regards.

  • Thanks a lot for that, it works perfectly!