One Star

How to send back custom xml in 404 response Rest Services

Hello,
Does anyone know how to send back a custom payload when a user tired to request an endpoint that is not available or incorrect.
The custom payload i would like to return would be something simple like:

<root>
<error>Invalid Endpoint</error>
</root>

I have tried to do this with a tXMLMap however it keeps throwing an error regarding:
"No message body writer has been found for response class DefaultDocument"
1 REPLY
Employee

Re: How to send back custom xml in 404 response Rest Services

Hi, try using a wrong call handler.
Also, in 5.2, one of the issues with properly determining a response type for a fault response has been fixed, in cases where a browser is used (which leads to a complex Accept HTTP header being sent) - so please try 5.2...