1. Gayathri Narayanan
  2. PowerBuilder
  3. Tuesday, 21 July 2020 22:39 PM UTC

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???  

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 July 2020 03:32 AM UTC
  2. PowerBuilder
  3. # 1

Hi Gavathri,

Can you do the following verifications to help address the issue:

  1. 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.
  2. 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,

 

Comment
There are no comments made yet.
Gayathri Narayanan Accepted Answer Pending Moderation
  1. Wednesday, 29 July 2020 19:20 PM UTC
  2. PowerBuilder
  3. # 2

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

Comment
  1. Mark Lee @Appeon
  2. Monday, 3 August 2020 05:26 AM UTC
Hi 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.
  1. Helpful
There are no comments made yet.
Gayathri Narayanan Accepted Answer Pending Moderation
  1. Tuesday, 8 September 2020 19:46 PM UTC
  2. PowerBuilder
  3. # 3

Thanks for all the responses.

We moved the URLs from the cloud to development servers.  No fix was required from PB.  

Gayathri

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 8 September 2020 20:00 PM UTC
Thanks for sharing the solution!
  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.