My REST service needs to return a warning along with an XML representation of the Resource on a GET invocation. Is there any way to represent the warning other than using a Wrapper XML Node to encapsulate the Resource and the Warning?
Asked
Active
Viewed 37 times
1 Answers
0
It exists a dedicated header for warnings described in the HTTP specification:
The Warning general-header field is used to carry additional information about the status or transformation of a message which might not be reflected in the message. This information is typically used to warn about a possible lack of semantic transparency from caching operations or transformations applied to the entity body of the message.
Something like that:
HTTP/1.1 400 Bad Request
Warning: 299 ServiceName "Invalid input error: X is unrecognized parameter name."
According to your use case, it's something you could consider...
The only other place I see is the response payload...
Hope it helps you, Thierry

Thierry Templier
- 198,364
- 44
- 396
- 360