ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

TCP7531 unmonitored by YAJLR4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RBlanco
    replied
    Hi Scott, you are correct. I hope that by posting my experience will help others to do as you said. Surely, it was a misunderstanding on how IWS works, especially with RESTful services (i.e. wraps Java around it).

    Thank you, and keep us informed like always.

    Leave a comment:


  • Scott Klement
    replied
    It doesn't make any sense to call YAJL_writeStdout() from a program run via IWS.

    Please take the time to understand the examples and how they're meant to be used.

    Leave a comment:


  • RBlanco
    replied
    For the benefit of others who try to use IBM IWS (integrated web server) for REST calling RPGLE which call other RPGLE that bind to QZHBCGI, don't do it!

    IBM IWS does NOT handle CGI (i.e. QZHBCGI). You must create, or use, a non-IWS HTTP server instance.

    On the other hand, you can use REST with IBM IWS, as long as, the RPGLE export the data without CGI.

    Anyone else can contribute to my observation.

    Leave a comment:


  • RBlanco
    replied
    FYI, it seems to be an IBM i bug. I will post any update on this.

    Problem . . . . . . . . : Software problem data for QZHBCGI has been logged.

    Leave a comment:


  • RBlanco
    replied
    Display Message Details

    Message ID . . . . . . : TCP7531 Severity . . . . . . . : 00
    Date sent . . . . . . : 11/14/19 Time sent . . . . . . : 12:48:09
    Message type . . . . . : Escape
    From . . . . . . . . . : XXXXXX CCSID . . . . . . . . : 65535

    From program . . . . . . . . . : QZHBCGI
    From library . . . . . . . . : QHTTPSVR
    From module . . . . . . . . : QZHBCGI
    From procedure . . . . . . . : QtmhWrStout
    From statement . . . . . . . : 99

    To program . . . . . . . . . . : YAJLR4
    To library . . . . . . . . . : YAJL
    To module . . . . . . . . . : YAJLR4
    To procedure . . . . . . . . : YAJL_WRITESTDOUT
    To statement . . . . . . . . : 4947

    Leave a comment:


  • RBlanco
    replied
    Hi,

    Scott Klement's sample code YAJLSAMPE/CUSTDETAIL ran successfully until the call to procedure yajl_writeStdout(200: errMsg) which calls YAJL/YAJLR4. At this point YAJLR4 tries to write the header (notice that rc successfully contains the JSON data):

    rc = yajl_getBuf( jsonBuf: jsonSize );
    if rc <> yajl_gen_status_ok;
    errMsg = 'Failure reading YAJL generator buffer';
    return rc;
    endif;

    Headers = 'Status: ' + %editc(status:'X') + CRLF
    + 'Content-type: application/json; charset=utf-8' + CRLF
    + CRLF;

    QtmhWrStout( %addr(Headers) + 2 : %len(Headers) : errorCode );

    I don't understand why QtmhWrStout is causing a TCP7531error.

    Thank you for the help.

    Leave a comment:


  • Vectorspace
    replied
    I assume prior to calling yajl_writeStdout(), you have called other YAJL functions to construct a JSON document? Are you sure you have created a valid JSON document? E.g. you haven't missed out an end tag or something? It would help if you could post all the code so we can see what you are generating

    Leave a comment:


  • RBlanco
    started a topic TCP7531 unmonitored by YAJLR4

    TCP7531 unmonitored by YAJLR4

    I need help to find out why YAJLR4 is producing the TCP7531 error "All data provided was not successfully written to STDOUT.".

    The YAJLR4 statement line contains:
    QtmhWrStout( %addr(Headers) + 2 : %len(Headers) : errorCode );

    I created an IWS REST service which calls YAJLSAMPLE/CUSTDETAIL. The program executes fine until it runs the following statement which produces the error above:

    yajl_writeStdout(200: errMsg);

    The REST web service contains the library list:
    YAJL
    YAJLSAMPLE
    QHTTPSVR

    Thank you.
Working...
X