aka*_*rma 4 java rest soap web-services
肥皂和休息之间有什么区别
在设置一些新的Web服务或集成环境时,会多次提出此问题.哪一个更好.
我知道一些基本的区别,如下所述:
(1)Rest is based on http protocol (get,put,post,delete) , treating everything as a resource.
whereas SOAP is transport agnostic
(2)Soap works only with xml , Rest works with json/xml both.
(3)rest do not provide schema definition when implemented as json,
Soap will always provide schema definitions.
It will be easy to understand request/response schema and
their data type constraints when viewing schema information via WSDL by any client.
(4)The step of wsdl creation makes it difficult to make any changes in your
schema classes while implementing in soap.
Rest implementation is quite easy, we just need to make changes in pojo classes.
(5)Soap provides default error handling via faults.
We can also create our own custom faults.
In Rest we need to handle all error messages explicitly.
(6)Soap provides SoapHandler to intercept request both at client/server side
with both request/response.
we can use filters of j2ee or interceptors of Spring to intercept calls.
(7)Soap is fixed defined set of protocol, whereas rest is architectural style.
While implementing REST, developers can follow any rule,
for example
not using http protocol in well defined way.
While in Soap message part is defined as envelope.
one envelope=header+body+fault+attachment
Run Code Online (Sandbox Code Playgroud)
我仍在学习这些概念,并没有在休息和肥皂方面为这些服务的安全性做过工作.
据我所知,最好的答案是" 这取决于要求 ".
现在我想知道哪些要求有利于哪些实现?
什么时候应该选择肥皂和什么时候休息?请举例说明.
如果我错了,请纠正我.
谢谢
归档时间: |
|
查看次数: |
3805 次 |
最近记录: |