1. Steve DeWitt
  2. PowerBuilder
  3. Wednesday, 24 February 2021 19:51 PM UTC

We are using Powerbuilder 2019 build 2082 and the deployed applications are running on windows server 2012. The restclient object sendGetRequest() is returning a -1.

This works great on windows 10 from the IDE and it also works when deployed to a windows server 2016 vm.

All of our production servers for this application are windows server 2012 and we tested it on windows server 2016.

ls_url = "https://some_url.com"
lrc_insideview.SecureProtocol = 0
li_return = lrc_insideview.SendGetRequest(ls_url, ls_json)
    
The code is really simple. Does this work on windows server 2012?

 

Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Monday, 1 March 2021 01:20 AM UTC
  2. PowerBuilder
  3. # 1

Hi Steve,

The script below works well on Windows Server 2012(6.2.9200) on our end, I compiled the application on PB 2019 build 2082 which is the same version as yours then copy it to Windows Server 2012. Please give it a try on your side.

If the issue persists, please provide the detailed OS version and a simple PB application to reproduce it for us for more study, thanks.

RestClient lrc_P019
String ls_P019_ResPonse
lrc_P019 = Create RestClient
int li_rc

//Sets the request header to return a gzip package
lrc_P019.SetRequestHeaders("Content-Type:application/json;charset=UTF-8~r~nAccept-Encoding:gzip")
li_rc = lrc_P019.SendGetRequest('https://demo.appeon.com/PB/webapi_client/api/department/retrieve', ls_P019_ResPonse)
If lrc_P019.GetResponseStatusCode() = 200 Then
//Column name and type between dw_Data the returned JSON string ls_P019_ResPonse must match.
Else
//Checks if any error according to the value of ResponseStatuscode and ls_Response
End If

messagebox(string(li_rc), ls_P019_ResPonse)


Regards,
ZhaoKai

Comment
  1. Steve DeWitt
  2. Monday, 1 March 2021 20:03 PM UTC
OS is windows server 2012 R2 build (9600)
  1. Helpful
  1. Kai Zhao @Appeon
  2. Wednesday, 3 March 2021 03:38 AM UTC
Hi Steve,



Thanks for providing the sample script. I reproduced the issue on Windows Server 2012 R2, and it seems a site or OS-related issue. I failed to access the URLs below on IE on Windows Server 2012 R2, though both URLs work well on Chrome on the same machine. The RestClient object depends on Windows API, so it might have the same root cause as IE. We will escalate this problem to our development team for further analysis.



https://api.insideview.com

https://api.insideview.com/api/v1/company/17085



Regards,

ZhaoKai

  1. Helpful
  1. Arthur Hefti
  2. Wednesday, 3 March 2021 10:30 AM UTC
Hi

Windows Server 2012 R2 does not support HTTP/2 when using Windows System DLLs. It works when making not use of the system dlls like curl or OpenSSL.

Regards

Arthur
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 24 February 2021 20:12 PM UTC
  2. PowerBuilder
  3. # 2

Hi Steve;

  My concerns would be ....

1) You tested on W2016 but deployed to W2012. Hmmm?????

2) Your production environment does not have the TLS option turned on or the correct SSL certificates installed.

3) The "TimeOut" option is set too low.

4) Your production environment has HTTP/S blocked.

5) Your production environment uses a Proxy Server

6) Your W2012 production firewall needs to be configured

7) The App users MS-Windows privacy setting(s) prohibit HTTP traffic to/form certain IP addresses.

Food for thought.

Regards ... Chris

PS: a TRY..CATCH might expose what the actual -1 (general error) really is in the "Exception" object.

Comment
  1. Steve DeWitt
  2. Wednesday, 24 February 2021 20:21 PM UTC
1) I only tested on W2016 after 2012 failed

2) I used advancedrestclient on the 2012 server to test the API and that works fine.

3) timeout is not an issue. This is a very fast API

4) no proxy

5) we are not blocking http/s traffice

6) it isn't a firewall issue

7) no app user ms-windows privacy setting that prohibits traffic

8) if the advancedrestclient works shouldn't the prod environment be ok?



I can add a try/catch
  1. Helpful
  1. Steve DeWitt
  2. Wednesday, 24 February 2021 20:31 PM UTC
try/catch did not work as implemented below. I got nothing from this

try

li_return = lrc_insideview.SendGetRequest(ls_url, ls_json)

catch(exception e)

put_log_message(e.getMessage())

end try
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 24 February 2021 20:45 PM UTC
Thanks for that feedback Steve!

Sound like the next step could be either a) upgrade the server to W2016 (or higher) OR b) try upgrading to PB2019R2 / PB2019R3 (LTS edition) and try the App EXE built from that version.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 24 February 2021 19:59 PM UTC
  2. PowerBuilder
  3. # 3

Yes, it is supported.  Did you deploy the required runtime file for RESTClient to your Windows Server?

Comment
  1. Steve DeWitt
  2. Wednesday, 24 February 2021 20:22 PM UTC
I did deploy the required runtimefiles. I copied what was deployed to production 2012 server to the 2016 server and it works fine
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 24 February 2021 22:20 PM UTC
So you mean problem solved?
  1. Helpful
  1. Steve DeWitt
  2. Thursday, 25 February 2021 14:37 PM UTC
no the problem is not solved. I meant that I had deployed the required runtime files before I tested this on the production server and it failed anyway.

Then I copied the folder from the 2012 server to the 2016 server, so that I am testing the same exact deployed runtime and code, and it works on the 2016 server.
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.