开发者

Interview Question - How to handle SOAP Based and REST based Exceptions

开发者 https://www.devze.com 2023-01-05 10:42 出处:网络
Can some one pro开发者_运维知识库vide a very specific and to the point answer for this question ?I think the basics of it are, with REST you should return the proper http response code and enough info

Can some one pro开发者_运维知识库vide a very specific and to the point answer for this question ?


I think the basics of it are, with REST you should return the proper http response code and enough information for the client to correct the error, e.g. 404 if the resource can't be found, 400 if they client sent a bad request, 500 if the server generated an exception, etc. With SOAP it looks like you always have to return a 500 Response code and a special SOAP message that says exactly what the error was (according to the SOAP spec).

Here is a blog post comparing the two.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号