1. Daniel Gonzalez
  2. PowerBuilder
  3. Friday, 30 October 2020 18:52 PM UTC

Hello guys,
My name is Daniel and I'm Brazilian, work I'm using the powerbuilder 2019 r2 here, I'm always updating the version of the systems. My question is about RestClient.
I'm trying to do a retrieveone / retrieve via RestClient, to get the result directly in the DW, but I'm not getting it, when the result has two levels of Json return, I use the POST method.
I wanted something like importstring, DW is all external, like the fields of the same name from the POST return.
I attached the exported DW and below is the return that should come via retrieve in the DW:

 

{"cnpjer":"00000000",
"codMsg":"Teste Código",
"identdCtrlOptIn":"Teste Identificador Controle OPT-IN",
"identdCtrlReqSolicte":{"codErro":"ERR0000",
"value":"1"},
"identdPartAdmtd":"Teste Identificador Participante Administrado",
"identdPartPrincipal":"Teste Identificador Participante Principal",
"sitRetReq":"1"}

Attachments (1)
Who is viewing this page
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Monday, 2 November 2020 10:12 AM UTC
  2. PowerBuilder
  3. # 1

Hi Daniel,

I suggest that you can try with the datawindow syntax d_rest_call which I modified and see if it can work around this issue (please refer to the attachment):

You can refer to the following link for detail:

https://docs.appeon.com/pb2019r2/powerscript_reference/ch10s633.html 

For the RetrieveOne function, the JSON string returned from the RESTFul Web service APIs can be an array in the two-level plain JSON format (see Plain JSON: two-level structure in Application Techniques for details) or a JSON object.

For the Retrieve function, the JSON string returned from the RESTFul Web service APIs must be an array in the two-level plain JSON format (see Plain JSON: two-level structure in Application Techniques for details).

So the operation you provided of importing the two-level JSON object content into the DataWindow is not supported.

Regards,

 

Attachments (1)
Comment
There are no comments made yet.
Daniel Gonzalez Accepted Answer Pending Moderation
  1. Saturday, 31 October 2020 13:26 PM UTC
  2. PowerBuilder
  3. # 2

Hello Armeen, thanks for responding.
So, I don't program in .NET yet, I created a DW in the powerbuilder and tried to retrieve it using the RESTClient object. I checked the link you sent me, are the examples of datastores created in .NET? I would like to know if you can do this retrieve / retrieveone, using only an external DW, or something?

Comment
  1. Armeen Mazda @Appeon
  2. Saturday, 31 October 2020 17:33 PM UTC
Yes, you can. The way you use it is by running the .NET DataStore on a Web server and calling it with RESTClient from PowerBuilder or PowerServer. This is cloud architecture.
  1. Helpful
  1. Daniel Gonzalez
  2. Saturday, 31 October 2020 18:02 PM UTC
That's right,

Thank you again.

Get to work.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Saturday, 31 October 2020 18:15 PM UTC
You’re very welcome.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 30 October 2020 20:51 PM UTC
  2. PowerBuilder
  3. # 3

The REST API you are calling is developed with .NET DataStore?

Is the REST API returning two-level structure JSON?  Please read this documentation: https://docs.appeon.com/pb2019r2/application_techniques/ch18s01.html

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.