简体   繁体   English

如何使用自顶向下的方法构建REST Web服务?

[英]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,但它们不仅限于:

  1. RAML. 肾错构瘤。
  2. Swagger. 昂首阔步。
  3. WADL. WADL。

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.

相关问题 如何使用自上而下的 web 服务? - How to consume a top-down web service? 自上而下的 web 服务和自下而上的 web 服务有什么区别? - What is the difference between a top-down web service and a bottom-up web service? 使用 AXIS1 自上而下的 Web 服务生成将我的 complexType 分开 - Top-down Web Service Generation using AXIS1 is taking my complexType apart 如何在Java中创建自上而下的重载构造函数 - How to create a top-down overload constructor in java 用自上而下的方法用Java设计API - 写Javadoc是最好的起点吗? - Designing APIs in Java with top-down approach - Is writing up the Javadoc the best starting point? 无法使用二维数组缓存将“自上而下的记忆化”方法应用于子集总和 - Unable to apply “Top-Down Memoization” approach to Subset Sum using 2d array cache 自上而下的解析与递归语法 - Top-Down Parsing with recursive grammar HotSpot JIT内联策略:自上而下或下至上 - HotSpot JIT inlining strategy: top-down or down-top 如何在不覆盖现有代码的情况下更改自上而下的Web服务 - How to change a top down web service without overwriting existing code 关于自上而下的方法soap web 服务wsimport 工具问题wsimport 在jdk bin 文件夹中找不到所以请解决这个问题 - Regarding top down approach soap web service wsimport tool issue wsimport not found in jdk bin folder so please fix this issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM