I have created a RESTful API in APIGateway which invokes a different service hosted in a separate webmethods EAI box.
Now when the service returns success, my API returns the payload correctly. But when it returns failure with HTTP codes 500 (say) although the response body is coming good with errorcode and error descr from the native service, the REST API is not able to forward the same.
Instead it gives a generic failure message:
Mediator encountered an error: Native service provider error. Code : 500 while executing operation
which is not explanatory to the caller system.
How to get the correct error code and error descr from the native service via API Gateway? Please suggest.