MVP
Here is my code. The block in red returns 1 (success code) in development and also in the exe when deployed on a machine which has PowerBuilder 2017 R3 installed
But when attempting to run this on a user machine without PowerBuilder, it returns -1 into li_rc and -3 into l_i_response
integer li_rc, l_i_response
String ls_ReturnJson, l_s_authorization
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient
l_s_authorization = 'Bearer' + " " +mle_accesstoken.text
lnv_HttpClient.SetRequestHeader("Authorization",l_s_authorization)
li_rc = lnv_HttpClient.SendRequest("GET", "<url site name>")
l_i_response = lnv_HttpClient.GetResponseStatusCode()
if li_rc = 1 and l_i_response = 200 then
lnv_HttpClient.GetResponseBody(ls_ReturnJson)
mle_body. text = ls_ReturnJson
Messagebox(string(l_i_response), ls_ReturnJson)
Else
lnv_HttpClient.GetResponseBody(ls_ReturnJson)
mle_body. text = ls_ReturnJson
Messagebox(string(l_i_response), string(li_rc) + '-' + ls_ReturnJson)
end if
Client machines have pbhttpclient170.dll, pbjson170.dll, pboauth170.dll, pbrestclient170.dll in the same directory as the exe. We have a lot of httpclient calls in our real application. As we found that the client machine could not connect, we wrote the simple code above to check what happens when we send requests using lnv_HttpClient.SendRequest
Any ideas, please???
Thanks for all the responses.
We moved the URLs from the cloud to development servers. No fix was required from PB.
Gayathri
Thank you for your reply.
We deployed this in many machines. It works on some machines without powerbuilder. All the dll directories have been copied as well. So, we know coding is good and dlls are fine as testing went good in the machines in which they work.
Few machines however return -1(General Error) and -3(Cannot connect to the Internet). Internet is very much available on machines where it does not work. Works from postman though.
We had to delay the release by one week due to these problems. Any ideas are appreciated.
Gayathri
It seems that this issue is related to the client environment settings.
1. Please check if there is any antivirus software or Active Directory policy enabled. If yes, please disable them and try again.
2. Can you also confirm that if you have enabled the proxy settings on your IE Browse and whether that is the cause of this issue.
You can refer to the following link for details on a similar issue posted by another customer:
https://community.appeon.com/index.php/qna/q-a/slowness-in-httpclient
3. Can you also compare the two client machines, the one that works and one that doesn’t work, to find out the different settings between them.
Can you do the following verifications to help address the issue:
Visit your url site with IE and see if it works in your client machine. Or use other tools like SoapUI , Postman to access your url site and see if it works on your client machine.
Copy all the PB runtime dlls files (default path: C:\Program Files (x86)\Appeon\Shared\PowerBuilder) from your PB develop machine to the client machine and see if it works?
Regards,