[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI/Apache/YAJL



   Hello
   If you use variable length field, the pointer (%addr())  should point
   to the data so try  +2 or +4
   depending on your compiler level you can also add *DATA
   docNode =  yajl_buf_load_tree( %addr(CartItms + 2) :
   %len(%trim(CartItms)) : errMsg);
   Paul
   From:        "Bak, Doug (LMF)" <Doug.Bak@xxxxxxxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Date:        30/03/2015 23:06
   Subject:        HTTPAPI/Apache/YAJL
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   I'm hoping someone else can look at this and help figure out why it's
   not working...
   When I use: docNode = yajl_stmf_load_tree( '/tmp/example.json' : errMsg
   );
   everything works fine, but I really want to use the data coming in from
   a webservice call.
   But when I read stdin from an Apache instance with:
   D CartItms        s          32767a   varying
   .
   sz = fgets(inpbuf: %size(inpbuf): stdin);
   if (sz <> *null and %len(%str(sz))>1);
     CartItms = %str(sz);
   endif;
   .
   docNode =  yajl_buf_load_tree( %addr(CartItms) : %len(%trim(CartItms))
   : errMsg);
   errMsg contains:  'lexical error: invalid char in json text.'
   The text in the file /tmp/example,json is identical (copy/paste) as the
   text being submitted through a CGI call through Apache.
   Here's the data being sent in:
   {"Id":1,"CustomerId":30984,"CabinetNumber":1,"CabinetName":"Oncology","
   PurchaseOrder":"12345Z","Items":[{"Id":1,"OrderId":1,"Order":1,"Product
   Id":12345,"Quantity":5,"CabinetNumber":1,"CabinetName":"Oncology"},{"Id
   ":2,"OrderId":1,"Order":1,"ProductId":34567,"Quantity":13,"CabinetNumbe
   r":1,"CabinetName":"Oncology"}]}
   Thanks in advance,
   Doug
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------