Hi,
I started testing HTTPClient for the Appeon Mobile app this week.
I'm using the json placeholder test API and the same code as in your tutorial:
PowerBuilder 2017 R2 New Feature: REST - Appeon Community
It works on desktop as expected but when I deploy to the Mobile App I have no results & GetResponseStatusCode returns -1.
Is there still something not supported in this release for Mobile?
Versions I'm using:
Product Version: PowerServer (PB Edition) 2019 Build 2082.00
Appeon Workspace: 1988.00
Regards,
Marcin
Please check to make sure that your "Mobile Templates" are up-to-date. You can do that by entering the "Packaging" tool from the PS Toolkit's toolbar. In the next dialogue, select the "PowerServer Mobile Templates Manager" link. From that next dialogue, please check that all the the latest templates for Android / iOS have been installed. If not, highlight and select the "Install" CB as required.
If you do update the mobile templates, please perform & full build & redeploy. Then retest your App's WS code again.
Regards ... Chris
We have finally managed to update our PowerServer Mobile to the latest version but the problem with HTTPClient is still there.
After few more tests I found the problem. It looks like the HTTPClient for PowerServer Mobile still does not support HTTPS URLs (API calls work OK with HTTP).
I understand that this won't be fixed if the PS Mobile will be discontinued?
PowerServer (PB Edition) 2020 Build 2703.00
Workspace 2703.00
Regards,
Marcin
I did not reproduce the HTTPS issue. The code below works fine in both Android and iOS and I use PowerServer 2020 Build 2703 too. Please try my script on your end to see if it works well.
Integer li_rc
String ls_string
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient
// send request using GET method
li_rc = lnv_HttpClient.SendRequest("GET", "https://demo.appeon.com/PB/webapi_client/employee/102")
// obtain the response data
if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then
lnv_HttpClient.GetResponseBody(ls_string)
end if
messagebox(string(li_rc), ls_string)
Please note that it is need to full deploy application after upgrade to PowerServer 2020, and please try removing Appeon Workspace and install it again.
If there is still the issue, please provide the information below for more study.
1 Does the same HTTPS URL work well on browsers on the mobile device?
2 Do other devices have the same issue?
3 The detailed device type and OS version that has the issue.
4 A simple PB case to reproduce the issue.
Regards,
ZhaoKai