1. Ricardo Colarina
  2. PowerBuilder
  3. Tuesday, 8 May 2018 00:13 AM UTC

Hi All,

I'm using PB 2017 R2 Build 1769.  And I've got the following simplified lines of codes to connect to a SharePoint URL:

lu_httpclient = create httpclient

li_rc = lu_httpclient.SendRequest('GET', ls_url)
li_rc2 = lu_httpclient.GetResponseStatusCode()
ls_message = lu_httpclient.GetResponseStatusText()

destroy lu_httpclient

This works fine in a VM running Windows 2012 R2 64-bit, where I've got administrator access.  However, in my work laptop running Windows 8.1 64-bit where I have non-administrator access, I get "401" and "Unauthorized" for li_rc2 and ls_message respectively.  I'm trying to replace GetURL with HTTPClient functions.  GetURL works on both VM and laptop.  And going to the site URL using IE and Chrome works fine.

Any ideas what's missing/going wrong?

Thanks.

Best Regards,

Ricardo

 

Alfredo Aldama Accepted Answer Pending Moderation
  1. Thursday, 10 May 2018 03:38 AM UTC
  2. PowerBuilder
  3. # 1
Hi, My opinion: You need authentication. Regards,
Comment
  1. Ricardo Colarina
  2. Thursday, 10 May 2018 21:36 PM UTC
Thanks Alfredo.

  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 9 May 2018 13:59 PM UTC
  2. PowerBuilder
  3. # 2

I have an example that does the same thing:

http://www.topwizprogramming.com/freecode_winhttp.html

Comment
  1. Ricardo Colarina
  2. Thursday, 10 May 2018 00:25 AM UTC
Thanks Roland.  Just tested "Get" and I'm also getting "401" and "Unauthorized".  I was hoping someone can point me to the right direction on how to accomplish the same thing successfully using the new HTTPClient object in PB 2017 R2.

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 8 May 2018 13:38 PM UTC
  2. PowerBuilder
  3. # 3

Hi Ricardo;

   Did you set the secureprotocol property of the HTTP Client object!

Regards ... Chris

Comment
  1. Ricardo Colarina
  2. Wednesday, 9 May 2018 01:13 AM UTC
Hi Chris,



Yes, I tried from 0 to 5, but no effect.  Note that I didn't have to set this in my VM where I have admin access.  Also, I've got Success with "https://community.appeon.com" and "https://www.google.com.au/" as the URL, so it looks like a permissions issue.  However, as I mentioned before, GetURL (still) works.



Thanks.



Ricardo

  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.