Midrange News for the IBM i Community


Posted by: Doug Feeman
HTTPPOSTCLOBVERBOSE Have Variable Request Data
has no ratings.
Published: 16 Sep 2017
Revised: 18 Sep 2017 - 279 days ago
Last viewed on: 24 Jun 2018 (574 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

HTTPPOSTCLOBVERBOSE Have Variable Request Data Published by: Doug Feeman on 16 Sep 2017 view comments(3)

Can HTTPPOSTCLOBVERBOSE use a variable as the request data? If I replace ':pData)) as UPS;' in the code below with 'GET_CLOB_FROM_FILE('/ifsdir/file.txt') )) as UPS;' the code works as expected and I receive data from UPS. If I use the code below it's like no request data is sent to UPS. So I wondering can the request data be a variable and how would the syntax look? We are on an Iseries V7.1. Thanks.

 

0172.11 C                   eval      pData      =
0172.12 C                               'GET_CLOB_FROM_FILE(~'
0172.13 C                             + %trim(#lcifsfilnam)
0172.14 C                             + '~)'
0172.15 C     $tilde:$quote xlate     pData         pData
0181.02 C* Transmit PLD upu178.txt to UPS and receive response message from UPS
0181.04  /free
0181.05   replystmf_Name = '/dfreeman/upu178rm.txt';
0181.06   replystmf_NL   = %len(%trimr(replystmf_name));
0181.07   replystmf_FO   = SQFOVR;
0181.17   exec sql
0181.23    SELECT responseMsg,responseHttpHeader
0181.24    INTO  :replyStmf, :replyHdr
0181.25    FROM   TABLE(SYSTOOLS.HTTPPOSTCLOBVERBOSE(
0181.29                  'https://onlinetools.ups.com/webservices/Track',
0181.30                  '<httpHeader>  +
0181.31                   <header name="Content-type" +
0181.32                          value="application/xml"/> +
0181.33                   </httpHeader>',
0181.34                  :pData) ) as UPS;

 

 

 

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS