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.