|
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Ofup
Therrien, Paul
Sent: Thursday, May 17, 2018 3:15 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: FW: json_table httpgetclob and header data
Jose,
I was able to run your example and it worked fine....
I think the issue I am having is with the header data. I need to load
header data into my request to GetResponse.Jose
When I attempt to execute your example with some dummy header data:
select * from JSON_TABLE(systools.httpGetClob( 'https://min-
api.cryptocompare.com/data/price?fsym=BTC&tsyms=EUR', 'Content-Type:
application/json' ), '$'
columns(price_char varchar(10) path '$.*',
price_dec dec(10, 2) path '$.*',
price_json varchar(25) format JSON path '$')) as x
;
I get the same "Content is not allowed in prolog." Error.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
PerezI
Sent: Thursday, May 17, 2018 3:14 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-
l@xxxxxxxxxxxx>
Subject: Re: FW: json_table httpgetclob and header data
Something must be wrong in the way you are building your GET request,
tried this from ACS and is working fine.<joseenocperez.jp@xxxxxxxxx>
Note: I ran with and without Read Committed and it worked fine.
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; select * from
JSON_TABLE(systools.httpGetClob( 'https://min-
api.cryptocompare.com/data/price?fsym=BTC&tsyms=EUR', null),
'$'
columns(price_char varchar(10) path '$.*',
price_dec dec(10, 2) path '$.*',
price_json varchar(25) format JSON path '$')) as x
On Thu, May 17, 2018 at 3:00 PM Jose Perez
wrote:statement
Paul in ACS try running this command before running your sql
vendor'sSET TRANSACTION ISOLATION LEVEL READ COMMITTED, try with a null or
blank header and make sure the token is correct.
On Thu, May 17, 2018 at 12:28 PM Therrien, Paul
<ptherrien@xxxxxxxxxxx>
wrote:
Cross posting from Midrange list .. .
We are on IBM I V7R2. I am using ACS SQLScripts v. 1.1.7.2
I am attempting to use httpgetclob and json_table to go to a
a(GetResponse), rest API.
I have tested the API in RPG usinig SK's LIBHTTP and it works like
HTTPGETCLOBcharm.
However, when attempting it via an ACS SQL session using
https://api3.getresponse360.com/v3/contacts?query[email]=@worldnet.att.it is failing.
Here is the statement:
select * from JSON_TABLE(
SYSTOOLS.HTTPGETCLOB('
net'issue.
,'Content-Type: application/json
X-Auth-Token: api-key 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3
X-Domain: email.ourdomain.com'
),'$'
Columns(contactid varchar(4) PATH 'lax $.contactid',
email varchar(100) PATH 'lax $.email',
changedOn varchar(20) PATH 'lax $.changedOn',
createdOn varchar(20) PATH 'lax $.createdOn')
) as t ;
I am getting this error:
SQL State: 38000
Vendor Code: -4302
Message: [SQL4302] Java stored procedure or user-defined function
SYSTOOLS.HTTPGETCLOB, specific name HTTPG00005 aborted with an
exception "Content is not allowed in prolog."
I am thinking that header statements:
'Content-Type: application/json
X-Auth-Token: api-key 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3
X-Domain: email.ourdomain.com'
are somehow causing the error and this is possibly a formatting
to
1. Is there something obviously wrong with my statement?
2. Is there a debugging option I can turn on in the ACS SQL client
ahelp me debug HTTPGETCLOB? I would love to determine the issue via
my own resources if possible.
3. Perhaps HTTPGetClob is not what I really want to do?
Any and all help appreciated.
Paul
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take
(RPG400-L)--moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
affiliate
link: http://amzn.to/2dEadiD
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx Tosubscribe,
unsubscribe, or change list options,(RPG400-L)
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx Tosubscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
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.