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



Thanks Nadir. I have voted.

Another untested alternative was to use the HTTP header array output parameter with an entry of "X-Status-Reason: <reason for failure>"

Would this work with the 4xx / 5xx status codes?

Thanks again!

Mitch

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Nadir Amra
Sent: Friday, June 02, 2017 11:46 AM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] IWS Rest Failure Response

At this time, no. IBM is working on adding the ability to do this. Vote for it in RFE [1]

[1]
https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=90642




From: Mitch Gallman <mgallman@xxxxxxxxxxxx>
To: "web400@xxxxxxxxxxxx" <web400@xxxxxxxxxxxx>
Date: 06/02/2017 10:39 AM
Subject: [WEB400] IWS Rest Failure Response
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxx>



Using IWS I have a RESTful web service.

If some of the business validation fails for the request I return either a
403 or a 409. However, when setting a 4xx or 5xx status the output is not
returned to the client.

Is there a way for me to communicate the reason for the failure (ie
"Concurrent request not allowed", "Invalid User", "Not authorized for this
action", "Record already approved") back to the client while still using
those status codes?

My fallback plan is to return 200 Ok with output parameters with a generic
status field ("success"/"fail"/"error") and message field that would
indicate the reason for failure or error.

Mitch Gallman | U.S. Xpress, Inc.
IBM i Applications Developer


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.