× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dean,

text/json will work fine. it's just the "application" that does it. There has been a lot of talk about it but I never heard of a ways to change it. I think it is hard coded in Apache.
But if you can change to ContentType = text/json then you don't have to translate.

Thanks
John Slanina


-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Dean Eshleman
Sent: Thursday, September 07, 2017 4:46 PM
To: web400@xxxxxxxxxxxx
Subject: Re: [WEB400] CGIDEV2 and REST web services

John,

Is there a setting in Apache that would make the translation happen automatically? Should I specify a different content-type or am I just stuck with having to do the translation?

Dean Eshleman

On 9/7/2017 4:31 PM, Slanina, John wrote:
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/>

______________________________________________________________________
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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.