1

I am getting 500 error code and its a SOAP format. I see HTML, SOAP 1.1 & SOAP 1.2 formats available for response when there is an exception in my pass thro service for example when wrong endpoint request, it gives 500.

I want to change it to 400 or 404 for invalid request/not found. Please advise for updating it for a SOAP/JSON response. It would be nice to know for both the format.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Kumar
  • 51
  • 7

1 Answers1

2

Its very simple: Add a Compute Node, set the atribute "compute node" to "LocalEnvironment and Message", in the code you need:

For SOAP messages:

SET OutputLocalEnvironment.Destination.SOAP.Reply.Transport.HTTP.ReplyStatusCode = 404;

For REST messages:

SET OutputLocalEnvironment.Destination.HTTP.ReplyStatusCode = 500;
  • Thanks for sharing the solution. I really appreciate it. However seems like this is for SOAP, what would be the options for REST ? – Kumar Nov 03 '18 at 14:26
  • sorry I have misunderstood, but now i have added a solution for REST and SOAP – gabriel felipe kalb Nov 05 '18 at 11:21
  • Thank you so much Gabriel. I really appreciate it. – Kumar Nov 06 '18 at 14:29
  • Is there any way to set its description as well, like ReplyStatusDescription. In case of 200 it returns 200 OK. But after changing reply status code other than 200 it returns only the number like 204. – Jamshoo Lakhani Jan 15 '20 at 13:32