我真的无法区分REST和POX Web服务。 我的意思是,POX不能被视为具有XML消息定义的REST Web服务吗?
I really can't get the difference between REST and POX web services. I mean, couldn't POX be considered as a REST web service with XML message definitions?
最满意答案
这取决于您的“普通旧XML”包含的内容。
问题是,POX过去常常与SOAP进行比较。 SOAP是一种非常具体的方法,可以通过(大部分)HTTP进行XML,人们已经通过HTTP进行“普通的旧XML”了。 SOAP受到了很多批评,因为它使人们用POX做的事情变得复杂。 但我不会谈到这一点,我想说的是人们使用POX来做RPC 。
REST不是RPC。 在REST中,XML是资源的表示,而不是RPC中的消息定义。 还有一个非常重要的REST约束,人们似乎忘记或忽略了对返回的XML施加约束: 超媒体约束或HATEOAS 。
如果您想了解有关POX如何适应REST的更多信息,我建议您阅读本文: Richardson成熟度模型,迈向REST的荣耀 。
It depends on what your "Plain Old XML" contains.
The thing is, POX used to be compared with SOAP. SOAP is a very specific way to do XML over (mostly) HTTP and people were already doing "plain old XML" over HTTP. SOAP got a lot of criticism because it complicated the things people were already doing with POX. But I won't go into that, what I'm trying to say is that people used POX to do RPC.
REST isn't RPC. In REST, the XML is a representation of a resource, not a message definition as in RPC. There is also a very important REST constraint that people seem to forget or ignore that imposes constraints on the returned XML: the hypermedia constraint or HATEOAS.
If you want to find out more about how POX fits in REST, I recommend reading this article: Richardson Maturity Model, steps toward the glory of REST.
更多推荐
发布评论