Resolved error using OAuthClient REST
- New
- How-to
-
JOSE WILLIAM ROMERO OLIVOS
- PowerBuilder
- Tuesday, 24 March 2026 04:06 PM UTC
Dear Sirs, I'm having the following problem consuming a REST service of type AUTH, using OAuthClient and OAuthRequest.
I'm using PowerBuilder 2025, and the problem is as follows:
1) The first time I consume the service, it returns 200 OK.
2) The second time I consume it, it returns a 500 error.
Codigo Error: 500
Internal Server Error HTTP/1.1 500 Internal Server ErrorCache-Control: no-storeDate: Tue, 24 Mar 2026 14:48:56 GMTPragma: no-cacheContent-Length: 0Set-Cookie: cookiesession1=678A3EE1C94D5211D2A6253D48144728;Expires=Wed, 24 Mar 2027 14:48:56 GMT;Path=/;HttpOnlyRequest-Context: appId=cid-v1:2156ef92-866c-4e6e-a5b7-16e25463a3e9X-Frame-Options: SAMEORIGINStrict-Transport-Security: max-age=31536000; includeSubDomains; preloadX-Content-Type-Options: nosniffX-Permitted-Cross-Domain-Policies: noneX-XSS-Protection: 1; mode=blockReferrer-Policy: no-referrer
The error persists until I completely exit the application, log back in, and then it again returns 200 OK.
The problem isn't with the server being consumed, because using Postman, there are no issues.
Can anyone help me figure out what might be happening?
Thank you very much.
This is part of my code in PowerBuilder 2025
loa_Request.method="POST"loa_Request.SetAccessToken(ls_access_token)loa_Request.url = ls_url_consultar_profesional_saludloa_Request.setbody(ls_professional_json)loa_Request.setheader("Ocp-Apim-Subscription-Key",ls_Ocp_Apim_Subscription_Key)
loa_Client = Create OAuthClient
li_rtn = loa_Client.requestresource( loa_Request, lrr_Response )
lrr_Response.GetBody(ls_Body)
ll_status_code = lrr_Response.getstatuscode()
If li_rtn = 1 Then
lrr_Response.GetBody(ls_Body)
End If
destroy loa_Client;
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.