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



Remember HTTP status codes are for the state of the HTTP communications,
not what happened in the background (ie, the data they sent was invalid)

I have seen payloads returned with 4xx 5xx codes before though. Not sure
what the RFC is on that offhand. But if IBM is returning no payload, I
would venture to guess that is the correct method as most other protocols
IBM is VERY adherent to the RFCs... almost to a fault sometimes. :)


Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #13 <https://www.bvstools.com/mailtool.html>: The ability
to use an IFS stream file as the body of the email (either text or html).

On Thu, Jul 25, 2019 at 10:52 AM Suren K <suren7437@xxxxxxxxx> wrote:

Hi Greg,

Yes, i am also planning to do the same way. Like populate the status code
in the Error Data Structure and requesting client to take care of
displaying the http status code based on the Error Array.

On Thu, Jul 25, 2019 at 11:32 AM Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

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,

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
in Interface.

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

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

Follow-Ups:
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.