JSON、REST、SOAP、WSDL 和 SOA:它们如何链接在一起 [英] JSON, REST, SOAP, WSDL, and SOA: How do they all link together

查看:44
本文介绍了JSON、REST、SOAP、WSDL 和 SOA:它们如何链接在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前正在做一些考试,我正在努力解决一些概念.这些都在我的笔记中真的提到"过,但我真的不明白它们是如何联系在一起的.据我了解:

Currently doing some exams and I'm struggling through some concepts. These have all been 'mentioned' in my notes really but I didn't really understand how they all linked together. As far as my understanding is:

SOA - 一种使服务消费者/提供者进行通信的解决方案.(据我所知,这是其他一切的总称)

SOA - a solution to make service consumers/providers communicate. (as far as I understand this is the umbrella term for everything else)

WSDL - 一种描述提供者服务的语言.

WSDL - A language that describes the provider service.

SOAP - 服务用于发送消息的 XML 协议包装器".与 WSDL 一起工作以提供参数?

SOAP - A XML protocol 'wrapper' used by the services to send messages. Works in conjunction with WSDL as to provide parameters?

REST - 一种在功能上类似于 SOAP 但避免使用 XML 的设计模式?(真的不确定这个)

REST - A design pattern that is similar to SOAP in function but avoids the XML? (really not sure about this one)

JSON - 使用 javascript 的 XML 的替代方案?(也不确定这个)

JSON - An alternative to XML that uses javascript? (not sure about this one either)

环顾互联网,似乎没有明确定义所有这些是什么以及它们如何相互关联.

Looking around in the internet there doesn't seem to be a clear definition of what all of these are and how they interlink.

推荐答案

假设您正在开发一个 Web 应用程序,并且您决定将功能与应用程序的表示分离,因为它提供了更大的自由度.

Imagine you are developing a web-application and you decide to decouple the functionality from the presentation of the application, because it affords greater freedom.

您创建一个 API,并让其他人也通过它实现自己的前端.你刚刚在这里做的是实现一个 SOA 方法,即使用网络服务.

You create an API and let others implement their own front-ends over it as well. What you just did here is implement an SOA methodology, i.e. using web-services.

Web 服务使功能构建块可通过标准访问独立于平台和编程语言的互联网协议.

Web services make functional building-blocks accessible over standard Internet protocols independent of platforms and programming languages.

因此,您在处理和生成有用的东西的后端(网络服务)和前端(消费数据)之间设计了一种交换机制,前端可以是任何东西.(网络、移动或桌面应用程序,或其他网络服务).这里唯一的限制是前端和后端必须说"同一种语言".

So, you design an interchange mechanism between the back-end (web-service) that does the processing and generation of something useful, and the front-end (which consumes the data), which could be anything. (A web, mobile, or desktop application, or another web-service). The only limitation here is that the front-end and back-end must "speak" the same "language".

这就是 SOAP 和 REST 的用武之地.它们是您选择与网络服务通信的标准方式.

That's where SOAP and REST come in. They are standard ways you'd pick communicate with the web-service.

SOAP:

SOAP 内部使用 XML 发送数据来回.SOAP 消息具有严格的结构,然后需要解析响应 XML.WSDL 是对可以发出哪些请求、使用哪些参数以及它们将返回什么的规范.它是您的 API 的完整规范.

SOAP internally uses XML to send data back and forth. SOAP messages have rigid structure and the response XML then needs to be parsed. WSDL is a specification of what requests can be made, with which parameters, and what they will return. It is a complete specification of your API.

休息:

REST 是一种设计理念.

REST is a design concept.

万维网代表了系统的最大实现符合REST架构风格.

The World Wide Web represents the largest implementation of a system conforming to the REST architectural style.

它不像 SOAP 那样严格.RESTful 网络服务 使用标准的 URI 和方法来调用网络服务.当您请求一个 URI 时,它会返回一个对象的表示,然后您可以对其执行操作(例如 GET、PUT、POST、DELETE).你不限于选择 XML 来表示数据,你可以选择任何真正的东西(包括 JSON)

It isn't as rigid as SOAP. RESTful web-services use standard URIs and methods to make calls to the webservice. When you request a URI, it returns the representation of an object, that you can then perform operations upon (e.g. GET, PUT, POST, DELETE). You are not limited to picking XML to represent data, you could pick anything really (JSON included)

Flickr 的 REST API 更进一步,还可以让您返回图像.

Flickr's REST API goes further and lets you return images as well.

<小时>

JSONXML 在功能上是等效的,并且是常见的选择.还有基于 RPC 的框架,如基于 Protobufs 的 GRPC 和 Apache Thrift,可用于 API 生产者和消费者之间的通信.Web API 最常用的格式是 JSON,因为它易于在每种语言中使用和解析.


JSON and XML, are functionally equivalent, and common choices. There are also RPC-based frameworks like GRPC based on Protobufs, and Apache Thrift that can be used for communication between the API producers and consumers. The most common format used by web APIs is JSON because of it is easy to use and parse in every language.

这篇关于JSON、REST、SOAP、WSDL 和 SOA:它们如何链接在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆