×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Paul in ACS try running this command before running your sql statement
SET 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 vendor's
(GetResponse), rest API.
I have tested the API in RPG usinig SK's LIBHTTP and it works like a charm.
However, when attempting it via an ACS SQL session using HTTPGETCLOB it is
failing.

Here is the statement:

select * from JSON_TABLE(
SYSTOOLS.HTTPGETCLOB('
https://api3.getresponse360.com/v3/contacts?query[email]=@worldnet.att.net'

,'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 issue.

1. Is there something obviously wrong with my statement?
2. Is there a debugging option I can turn on in the ACS SQL client to help
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 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 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-2026 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.