|
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-Zwy7GipZuJhWk0Htik3J/w@xxxxxxxxxxxxxxxx] On Behalf Of Dean Eshleman
Sent: Thursday, September 07, 2017 4:27 PM
To:web400-Zwy7GipZuJhWk0Htik3J/w@xxxxxxxxxxxxxxxx
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.
POSThttp://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/>
As an Amazon Associate we earn from qualifying purchases.
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.