× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



actually there is a little more of the error message...

occurred on member QSQPTABL file QSQPTABL in library QSYS2. The error code
is 1. The error codes and their meanings follow:
1 -- The external program or service program returned SQLSTATE 38501. The
text message returned from the program is: AXISC ERROR :
HTTPTransportException: Cannot initialize a channel to the remote end.█GSKit
Error is 6003 - Access to the key database is not allowed. .

On Wed, Nov 23, 2022 at 11:58 AM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:

really weird...

now, if I call the sqlrpgle pgm directly from the command line it works
fine (calls the api and returns the desirable result).

However if I call an api from my front end (website) to come in through
the apache server and to that api pgm, I get the following error...

occurred on member QSQPTABL file QSQPTABL in library QSYS2. The error code

is 1. The error codes and their meanings follow:

1 -- The external program or service program returned SQLSTATE 38501.
The
text message returned from the program is: AXISC ERROR :


What is the reason for this?

Jay

On Wed, Nov 23, 2022 at 11:26 AM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:

aw man...

sadly but gladly....

you are right!

all is well now.

thanks!

On Wed, Nov 23, 2022 at 10:29 AM Martijn van Breden <
m.vanbreden@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi Jay

From the documentation (
https://www.ibm.com/docs/en/i/7.5?topic=functions-http-post) it says
that the message should be the second parameter and options should be the
third. To me it looks as they have switched places in your call.

Kind regards,

Martijn van Breden
lead software architect

--

Pantheon Automatisering B.V.
T. 0513 657 357
M. 06 2075 2931

E-mail disclaimer


-----Oorspronkelijk bericht-----
Van: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> Namens Jay Vaughn
Verzonden: woensdag 23 november 2022 15:36
Aan: RPG programming on the IBM i (AS/400 and iSeries) <
rpg400-l@xxxxxxxxxxxxxxxxxx>
Onderwerp: qsys2.http_post

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.



I have an api using qsys2.http_post that is working just fine when
called from ACS run sql scripts...

I'm moving it to embedded SQL in RPG and getting the following error
when running...

is 1. The error codes and their meanings follow:
1 -- The external program or service program returned SQLSTATE 38501.
The text message returned from the program is: ERROR : OPTION NOT JSON .

I have converted char for char... it is identical

Here is the embedded sql in rpg...
What is wrong and why am I getting this error?

l_url = 'https://api.twilio.com/2010-04-01/Accounts/'
%trim(l_apiKey)
'/Messages.json';

l_hdr = '{'
'"basicAuth":"'
%trim(l_apiKey) + ','
%trim(l_authToken) + '"'
',"header":"content-type,application/x-www-form-'
'urlencoded"'
',"sslTolerate":"true"'
'}';

l_bdy = '&To=+'
%char(i_phone)
'&From=REDACTED'
'&MessagingServiceSid='
%trim(l_msgSvcId)
'&Body='
%trim(i_msg);

exec sql
select ifnull("error_message",' ')
into :o_errorMsg
from json_table(
qsys2.http_post(:l_url
,cast(:l_hdr as varchar(855))
,cast(:l_bdy as clob(10k))
)
,'$' columns (
"error_message" char(100) path '$.error_message'
) error on error
) as x;

if sqlcode = 0;
return *on;
else;
return *off;
endif;


tia jay
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.