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

HTTPAPI/Apache/YAJL



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,"ProductId":12345,"Quantity":5,"CabinetNumber":1,"CabinetName":"Oncology"},{"Id":2,"OrderId":1,"Order":1,"ProductId":34567,"Quantity":13,"CabinetNumber":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
-----------------------------------------------------------------------