[英]How to build a REST web service with top-down approach?
I'm new in REST web services. 我是REST Web服务的新手。 I've always used SOAP to build a web service since WSDL and auto generate web service logic in Java code, but REST has a uniform contract so, we don't need to create a contract definition, SOA says top-down approach is the best way to create a decoupled web service but I have no idea how to create a REST service in top-down or bottom-up approach either.I would like something of your experience and how to create a REST web service with Java.
自从WSDL以来,我就一直使用SOAP来构建Web服务,并使用Java代码自动生成Web服务逻辑,但是REST具有统一的合同,因此,我们不需要创建合同定义,SOA表示自上而下的方法是创建分离的Web服务的最佳方法,但我也不知道如何以自上而下或自下而上的方式创建REST服务。我想从您的经验中了解如何使用Java创建REST Web服务。 It doesn't matter IDE or API.
IDE或API无关紧要。
Until very recently this was not possible. 直到最近,这还是不可能的。 You could not do top down with REST due to the lack of a REST WSDL.
由于缺少REST WSDL,您无法自上而下使用REST。 This is why a lot of enterprises never moved to REST, for example in banking transactions you want the interface to be well defined and strict.
这就是为什么许多企业从未使用过REST的原因,例如在银行交易中,您希望接口定义良好且严格。 You can create this strict definition in SOAP but previously it was hard in rest.
您可以在SOAP中创建这个严格的定义,但是以前很难。
REST is busy becoming more SOAP like some aspect with the need for well defined interfaces now being addressed by various competing standards. REST正变得越来越像某些方面的SOAP,现在各种竞争性标准都满足了对定义良好的接口的需求。 Or in plain english there is a lot of projects which are competing to become the WSDL of the REST world they are but no limited to:
或者用简单的英语说说,有许多项目正在竞争成为REST世界的WSDL,但它们不仅限于:
I have used some top down code generation in RAML and it was relatively good but very bleeding edge then. 我在RAML中使用了一些自上而下的代码生成,它虽然相对不错,但当时却非常前沿。
The question would be if you need such well defined interfaces why do you want to go REST? 问题是,如果您需要这样定义明确的接口,为什么要使用REST? The whole XML vs JSON argument is not a valid reason.
整个XML vs JSON参数不是正确的原因。 Bloated JSON can be bigger than optimal XML.
膨胀的JSON可能大于最佳XML。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.