application/json causing you to have to translate the data.
if ContentType = 'application/json';
monitor;
RdiLenOut = RdiRecLen;
RdiRec_P = %addr(RdiRec);
RdiRecOut_P = %addr(RdiRecOut);
rc = ibmIConv(hConv : RdiRec_P : RdiRecLen : RdiRecOut_P : RdiLenOut);
RdiRec = %trim(RdiRecOut);
RdiRecLen = %len(%trim(RdiRec));
on-error;
endmon;
endif;
Thanks
John Slanina
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Dean Eshleman
Sent: Thursday, September 07, 2017 4:27 PM
To: web400@xxxxxxxxxxxx
Subject: [WEB400] CGIDEV2 and REST web services
I'm trying to use CGIDEV2 to create some web services. I have it working when the input parameters are in the query string. Now, I'm trying to pass them in using JSON. I'm using SOAPUI to call the web service. Here is the raw request.
POST
http://as400.mma-online.org:8500/read/GetClientsForName/json HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
Content-Length: 54
Host: as400.mma-online.org:8500
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
{"firstname":" ", "middlename":" ", "lastname":"Mast"}
When I read stdin in my program to get the JSON string, I end up with garbage. What setting am I missing.
Dean Eshleman
Software Development Architect
Everence
1110 North Main Street
PO Box 483
Goshen, IN 46527
(800) 348-7468 ext. 3528
(574) 533-9515 ext. 3528
everence.com<
http://www.everence.com/>
______________________________________________________________________
Confidentiality Notice: This information is intended only for the individual or entity named. If you are not the intended recipient, do not use or disclose this information. If you received this e-mail in error, please delete or otherwise destroy it and contact us at (800) 348-7468 so we can take steps to avoid such transmission errors in the future. Thank you.
--
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.