I'm trying to run the code below which is supposed to create an error. The 2nd parameter of the QSYS2.HTTP_POST command is blank. The header authorization is also blank. I'm expecting an error such as 'No access token provided' to appear in my response file upu178shiprm.txt.
Instead, I get what appears to be garbage in my response file upu178shiprm.txt which is pasted below.
The replystmf is defined as a clob_file. I've also defined replystmf as 'sqltype(clob_file) ccsid(1208)' and 'sqltype(clob_file) ccsid(37)'.
D replystmf s sqltype(clob_file)
Does anyone have any thoughts on what is causing the unreadable response and what needs to be done to correct it?
I have other code where I'm successfully retrieving an authorization token from Fedex, sending the authorization token and data to the Fedex Ship API below, and still receiving an unreadable response. It's a different response than what is pasted below but still unreadable.
Any help would be appreciated. Thanks, Doug.
0182.00 /free
0183.00 replystmf_Name = '/xxxxxxxx/upu178shiprm.txt';
0184.00 replystmf_NL = %len(%trimr(replystmf_name));
0185.00 replystmf_FO = SQFOVR;
0186.00 Exec Sql
0187.00 VALUES QSYS2.HTTP_POST(
0188.00 'https://apis-sandbox.fedex.com/ship/v1/shipments',
0189.00 ' ',
0190.00 '{"headers":{'
0191.00 || '"content-type":"application/json",'
0192.00 || '"authorization":" ",'
0193.00 || '"ssltolerate":"true",'
0194.00 || '"x-locale":"en-US"'
0195.00 || '}}')
0196.00 into :replystmf;
0197.00 /end-free
0198.00 C*
Fedex Response (upu178shiprm.txt)
‹ ÿÊÁ
‚@ Ð_æœ"¦äz
ò'!v):L»£H¹[»k â¿'¼½%íHúÞèRa(„ŒHì8H3±
'8‚,‰·"´ªe' …dku˜ßf"F1æxªšpiŽU]^‹CXÔuU¯q`ç¨û $åJðæÉÞÖ|{Å*„ó‹É1 Fõí"-XþŒì<VàíÔQ¯C\îËYZö›´
------------------------------
Doug Freeman
------------------------------