Thanks - but I'm not sure how that helps Henrik?


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jun 26, 2017, at 12:33 PM, Henrik Rützou <hr@xxxxxxxxxxxx> wrote:

Jon here is a simple Web-service requester...

/copy qsrc,pxapihdr General H-Spec's

* powerEXT Service Program Connector
/copy qsrc,pxapicgicn Basic HTTP connecter & Productivity Services
/copy qsrc,pxapijsncn YAJL JSON connector

* Support for HTTPAPI by Scott Klement
/copy qrpglesrc,httpapi_h

* Declare Internal Variables
d dsp s 50a
d dspwait s 1a

d rc s 10i 0
d url s 2048a varying
d tmpFile s 256a varying

d jsonAddr s *
d jsonSize s 10u 0

/free
// Clear powerEXT Service Program & Responce Object
clearSrvPgm();

// construct a JSON message with YAJL support
yajl_genOpen(*on);
yajl_beginObj();
yajl_addNum('number':'123456');
yajl_addChar('name':'Anderson');
yajl_endObj();
yajl_getBuf(jsonAddr:jsonSize);

// Construct a temporary result file name for HTTPAPI
tmpFile = '/tmp/tst'+uniqueKey+'.json';

// Setup HTTPAPI Url and parms
HTTP_debug(*on);
HTTP_SetCCSIDs(1208:1208);
HTTP_SetFileCCSID(1208);

url = 'http://127.0.0.1:8080/pextcd2lib/yajl.pgm';

// Send HTTPAPI Request
rc = http_url_post( url
: jsonAddr
: jsonSize
: tmpfile
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'application/json');
// : 'text/plain');

// HTTPAPI Error Handling
if rc <> 1;
dsply %char(rc);
dsp = http_error;
dsply dsp;
*inlr = *on;
return;
endif;

*inlr = *on;
return;

On Mon, Jun 26, 2017 at 6:21 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

Yes - I guess that would work although the system's tendency to try and
"fix" the code page when you display IFS files would be an issue. I think
if I have no choice but to go that route then I'll use brads approach and
simply grab the buffer and look at it in debug.

However - the data is being sent by SoapUI and it is specifically being
told to send UTF8 - so I know what is being sent - it is what comes out of
Apache I guess that I have to study.

But the really annoying thing is that it was working!


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jun 26, 2017, at 12:05 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:


I tried with Binary/Binary since that appeared to best match my needs.
Any suggestions on what it should be if that is not correct?


If I understand correctly, YAJL is reporting "unsupported content type".
What if you receive from stdin, write to an ASCII text file, then call
yajl_stmf_load_tree() to process the ASCII file, as a test. You could
confirm the content of the stream file.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.




--
Regards,
Henrik Rützou

http://powerEXT.com <http://powerext.com/>
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



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.