|
Yes. I see that. I did mine before this was available. This is an
interesting thread, and Kevin's link below is very useful.
Just this week I was working with a REST Web Service (as the consumer)...
This particular one DID actually return a JSON payload with HTTP 4xx
errors. I thought that to be odd. Here is an example:
{
"message" : "Incorrect data supplied. The following order lines have not
been decided: R356858528-A-3, R356858528-A-1, R356858528-A-2.The following
order lines are not associated with the current order: R356858528-A.",
"status" : 400
}
In this case, the HTTP ERROR was 400.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Suren K
Sent: Thursday, July 25, 2019 11:25 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Reg: Web Service in IBMi
Hi Greg,
The Initial request is an RPG Program only.
I am receiving input in JSON string, but while sending it back i will just
populate the data into an Data Structure and Web Service itself will
convert the data into JSON format while sending it to the Client. So i am
using http status code to send the response code to the Client.
But as Kevin replied,
https://developer.ibm.com/tutorials/i-rest-web-services-server1/
400 and 500 range error messages don't send the body it seems. So in my
case i don't have any other option it seems.
Regards,
Surender K
On Thu, Jul 25, 2019 at 10:26 AM Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
I would like to help... but I don't understand what is processing your--
initial request (is it an RPG program, or something else?).
I have several web services running on our machine, but they are
invoking RPGLE pgms.. I can return whatever payload I want.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
Of Suren K
Sent: Thursday, July 25, 2019 9:59 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Reg: Web Service in IBMi
Hello Everyone,
Any suggestions on this one?
Regards,
Surender K
On Wed, Jul 24, 2019 at 10:15 AM Suren K <suren7437@xxxxxxxxx> wrote:
Hello Everyone,in Interface.
I started the Web Server in IBMi and configured a Export Procedure
which has 3 Parameters, Parameter 1 as Input (JSON String),
Parameter
2 as Output Response (JSON String) and Parameter 3 as httpStatus code.
Now whenever i am returning httpstatus code as 200 or 201 i can see
the Output response JSON string in my Interface (I am using
POSTMAN), but when i returning httpstatus code as 400 (Error) then
the Output JSON string is completely suppressed. I am not getting
the Output string
--
Is there is any configuration i need to enable to view the Output
string even when error code is not 200 or 201?
Regards,
Surender K
+1 7022091188
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.