Question

I've a REST service which in turn consumes a SOAP WebService. Incase if i get an exception while calling the SOAP WS, what kind of exception to be thrown from REST service ? Will it be RuntimeException with http status code 500 ? Or should i gracefully exit by giving a proper error message and code as response to the caller, if so, what would be the http status code in this case ?

Was it helpful?

Solution

If you get an exception from the SOAP service, I would say that returning an HTTP 500 Internal Server Error is the only legal response to give to the caller of the REST service. Anything else would be misleading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top