1. Marcos Bolonha
  2. PowerServer Mobile (Obsolete)
  3. Monday, 13 April 2020 13:26 PM UTC

Hi,

I'm getting an undefined error message when using HTTPClient object on mobile app. It is returning 0, but this code is not listed as a valid return result.

Integer li_rc
String ls_string
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient

// Sends request using GET method
li_rc = lnv_HttpClient.SendRequest("GET", "https://www.receitaws.com.br/v1/cnpj/00394460005887")

// Obtains the response data
if li_rc = 1 then
lnv_HttpClient.GetResponseBody(ls_string)
messagebox("Success",ls_string)
else
messagebox("Failed","SendRequest Failed: Ret code: "+string(li_rc)+" - Msg: "+lnv_HttpClient.getresponsestatustext())
end if


This API can be executed with success from any browser, and also by running it directly on PB.

 

Environment:

PowerBuilder CloudPro Edition - version 2019 R2 - build 2323

PowerServer (PB Edition) 2020 Build 2323.00

Android 9

 

Thanks in advanced.

Marcos

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 April 2020 18:05 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

Hi Everyone;

   This has now been fixed but you may need to perform these updates ...

  • Install PS2020 GA from the PB2019 R2 release
  • Install the 2328 MR
  • Open the PS "Packager" from your PS Toolkit inside of the PB2019R2 IDE
  • Then select the following ...
  • In the "templates dialog ...
  • If the 2023 template(s) are not installed. Highlight the template and then press the "Install" CB

Once the new templates are installed. Perform a full deploy!

HTH

Regards ... Chris

Comment
  1. Marcos Bolonha
  2. Thursday, 23 April 2020 23:01 PM UTC
Hi Chris,

Updates applied.

Thanks for you attention.

Marcos
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 24 April 2020 18:31 PM UTC
Awesome! Did that solve your issue?
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 April 2020 01:42 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2

Hi Marcos,

Thanks for reporting this problem! We reproduced it on our end and will do further research to figure it out. We will keep you posted about the progress.

Regards,
ZhaoKai

Comment
  1. Marcos Bolonha
  2. Tuesday, 21 April 2020 14:09 PM UTC
Hi ZhaoKai,



I've just installed the build 2328 and the HTTPClient is working fine on this build.



Thank you.



Marcos
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 21 April 2020 14:49 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 13 April 2020 16:38 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 3

Hi Marcos;

   The new HTTPClient object class in PowerServer is only fully supported in PS Web apps.

Regards ... Chris

Comment
  1. Marcos Bolonha
  2. Monday, 13 April 2020 17:44 PM UTC
Hi Chris,



Thanks for replying.



According to Appeon Documentation the HTTPClient is supported by PS2020 mobile:

https://docs.appeon.com/appeon_online_help/ps2020/features_help_for_appeon_mobile/supported_objects_for_mobile.html#Objects_HTTPClient



Also as you can see in the link below I tested HTTPClient successfuly some months ago, when Marco Meoni answered my question about a similar problem:

https://community.appeon.com/index.php/qna/q-a/update-rows-using-httpclient-webapi-on-mobile-app



In case HTTPClient really cannot be used on PS2020, could you give me some advise the best way to consume Web API on mobile app?



Regards.



Marcos
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 14 April 2020 20:05 PM UTC
For example ... If its an SSL requirement, that is not supported on PS Mobile. From the PS 2020 Help ...

"HTTPClient does not support SSL for PowerServer Mobile".

  1. Helpful
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.