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

查看:134
本文介绍了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)

在Internet上环顾四周,似乎没有一个明确的定义,这些都是什么以及它们如何相互链接.

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 方法,即使用Web服务.

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服务使功能性构建块可以通过标准进行访问 独立于平台和编程语言的Internet协议.

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

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

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进入的地方. 它们是您选择与Web服务进行通信的标准方式.

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是一个设计概念.

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 Web服务使用标准URI和方法来调用Web服务.当您请求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.


JSON XML 在功能上是等同的,是常见的选择.还有一些基于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天全站免登陆