1. Avory Rose Pastoral
  2. PowerBuilder
  3. Monday, 31 May 2021 03:48 AM UTC

I have created an application that used ldap login. 

Below is my sample code

 

boolean ls_val
jsonpackage lnv_pack1,lnv_pack2
jsonparser lnv_jsonparser

lnv_pack1 = create jsonpackage
lnv_pack2 = create jsonpackage
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient

 

ls_json = '{"user":"'+gs_userid +'", "password": "'+s_pass +'"}'

// Constructs a POST request (supports all headers)
lnv_HttpClient.SetRequestHeader("Content-Type", "application/json;charset=UTF-8")
// Content-Length header set by SendRequest

// Sends request using POST method (to add the string data to the body and set to the Content-Length header)
li_rc = lnv_HttpClient.SendRequest("POST", "http://www.sample.com/ldap/ldap.asmx/ldap", ls_json)

// Obtains the response data
if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then
lnv_HttpClient.GetResponseBody(ls_ReturnJson)
end if


lnv_pack1.loadstring(ls_ReturnJson)
ls_value = lnv_pack1.getvalue("d")
lnv_pack2.loadstring(ls_value)
ls_val = lnv_pack2.getvalueboolean("Status")

 

if ls_val then 

open(w_main)

end if

 

Above is my shortcut sample codes. Everything is working fine and I was able to login successfully using ldap.

But when I created an installer using inno setup and try to install it to other pc (that pc don't have any pb application installed) the user cannot login. My guess is that im missing a DLL. Attached the screenshot of  my .iss setup for my installer. 

 

Thank you so much.

 

 

 

 

 

Attachments (1)
Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 2 June 2021 05:36 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Avory,

I see you have pbjson190.dll deployed. But I don't see pbhttpclient190.dll.

As Chris already wrote: Look at PB Online help: https://docs.appeon.com/pb2019r3/application_techniques/ch09s02.html#PowerBuilder_runtime_files

HTH,

René

 

Comment
  1. Avory Rose Pastoral
  2. Wednesday, 2 June 2021 05:40 AM UTC
Thank you so much for pointing that out! I'll try it now. Will let you know if it will work. Thank you so much!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 31 May 2021 14:02 PM UTC
  2. PowerBuilder
  3. # 1

Hi Avory;

   Have a look in the PB Help using the keyword search "runtime". From there, you should find a link to the list runtime files required by feature & also Microsoft dependencies as well. Hopefully, that will point you to some missing DLL files that may also needed to be copied (unless you used the PB Packager utility).

  Also when I have done LDAP enabled PB Apps before, I could not deploy the PB Apps to the end users as they did not have any privileges to access the LDAP repository directly. Instead, I had to create a Web Service running in a elevated account Application Pool under IIS in order to perform the LDAP interactions. Once I has the WS, I could then called the WS from my PB Apps (even PowerServer Web/Mobile) to do the LDAP interactions. That also worked for non-PB Apps as well. Food for thought.

Regards ... Chris

Comment
  1. Avory Rose Pastoral
  2. Wednesday, 2 June 2021 02:44 AM UTC
Hi Chris,



Thank you for your insight. As what you can see from my posted sample I created a web service then call it in my app. My big guess on my problem is that I have a missing DLL. Because I tried to install it in another computer that has power builder installed then the application is running correctly and the user was able to login successfully but in a simple computer that no powerbuilder installed the user can't login. I have attached a photo on my posted question of DLL I include in my exe. Any idea what DLL I am missing? Thank you.
  1. Helpful
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Wednesday, 2 June 2021 06:28 AM UTC
  2. PowerBuilder
  3. # 2

Hi any idea where to download pbhttpclient.dll?

Comment
  1. René Ullrich
  2. Wednesday, 2 June 2021 07:32 AM UTC
It is part of your PB installation.
  1. Helpful
  1. Avory Rose Pastoral
  2. Wednesday, 2 June 2021 09:56 AM UTC
Yup sorry didn't saw it on my pb app folder. Have to search it in my appeon shared folder. It seems that dll is what i am looking. Problem solved. Thank you for the help.
  1. Helpful
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Friday, 2 September 2022 06:53 AM UTC
  2. PowerBuilder
  3. # 3

Hi Chris,

 

Do you know other way to consume LDAP login? Like to connect directly in LDAP/LDAP.dll without using webservice? I am not quite happy with the speed when my application start to connect with webservice. Sometimes, it takes 1 minute before the client successfully login to the application. 

 

 

Thank you

Comment
  1. Chris Pollach @Appeon
  2. Friday, 2 September 2022 13:36 PM UTC
Hi Avory;

Have you tried ... https://www.topwizprogramming.com/freecode_ldapquery.html

Regards ... Chris
  1. Helpful
  1. Avory Rose Pastoral
  2. Monday, 5 September 2022 00:44 AM UTC
Hello I can't open the ldapquery project usingmy PB 2019.
  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.