生成 REST 的客户端对象

发布于 2024-12-28 01:30:43 字数 243 浏览 0 评论 0原文

大家好: SOAP/WSDL 世界似乎非常擅长从数据模型生成对象,但我无法判断 Web 服务的 REST 方法是否支持相同的方法。在我看来,JSON 似乎正在成为大多数语言的新的通用、本机对象格式,从而消除了对特定于语言的 API 的任何需求。但是,我是网络服务游戏的新手。

因此我的问题是:是否有可以为我们自动生成 REST 客户端对象的工具?其次,在 Web 服务领域中是否习惯提供客户端对象来处理 REST 数据(这是处理 SOAP 数据所必需的)?

Hi Guys : It seems like the SOAP/WSDL world was very high on generating objects from data models, but I cannot tell wether the REST approach to web services favors the same approach. In my opinion, it seems as though JSON is emerging as the new common, native object format for most languages, thus obviating any need for language specific APIs. However, I'm new to the web services game.

Thus my question is : Are there tools which can autogenerate REST client side objects for us? And secondarily, is it customary in the web-services world, to provide client side objects for dealing with REST data (as is neccessary for dealing with SOAP data) ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

节枝 2025-01-04 01:30:43

“REST 世界”与“SOAP 世界”不同的是,它没有像 WSDL 这样的服务描述语言。至少,它并不那么统一。

  • 当然还有HTML。 REST 背后是 Web,忽视 HTML 是不公平的,因为它的目的正是描述您可以使用服务做什么。缺点是它最常见的形式不太适合计算机。因此,没有 html2java 可以将您的表单转换为对象。此外,编程模型与远程对象有很大不同,wsdl2java 等工具往往会导致这种情况。
  • 有 WADL,但不一定广泛普及。有一个 wadl2java 工具(请参阅这个问题也许也是如此)。
  • 它还取决于您所说的“REST”Web 服务:它是否真正正确使用了超媒体,或者只是将 XML/JSON 发送到漂亮的 URL。

What the "REST world" doesn't quite have in the same way as the "SOAP world" is a service description language like WSDL. At least, it's not quite as uniform.

  • There is of course HTML. Behind REST is the Web, and it would be unfair to dismiss HTML, since it has precisely the purpose of describing what you can do with the service. The downside is that it's not very computer-friendly in its most common form. Hence, there is no html2java that will turn your forms into objects. In addition, the programming model would be quite different to remote objects, which tools like wsdl2java tend to incur.
  • There is WADL, but it's not necessarily wide-spread. There is a wadl2java tool (see this question too perhaps).
  • It also depends on what you call a "REST" web service: does it really make proper use of the hypermedia, or is it just sending XML/JSON to a nice-looking URL.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文