发布网友 发布时间:2022-11-27 18:44
共1个回答
热心网友 时间:2023-11-09 01:48
最近项目做的东西比较多,一个不做Web的人也要开始看各种Web相关的东东了,hohoho...这几个概念最近一直在用,记录一下。总结和分析了各种的材料来源有这里的园子,WIKIPEDIA,百度百科,ESRI的文档库,还有身边有经验的同事。有些来自WIKI或者文档库的文章就不翻译了,原文表达的已经很到位了。
Web Service
Web services provide the ability for applications to communicate using messaging over many different protocols. Because web services provide a means to communicate between applications that are written both in the same programming language as well as in different programming languages, a language neutral means of communication was needed. XML is the format used to hold the information carried between the applications. The XML message is carried using SOAP (Simple Object Access Protocol). SOAP defines the headers and the valid means for passing messages. That passing of messages usually takes place over HTTP but it can actually be over any well know protocol, such as SMTP, FTP, or DCOM. SOAP takes the xml message and wraps it so that it can be routed to the receiving application and appropriaptely processed.
SOAP
简单对象访问协议,简单对象访问协议(SOAP)是一种轻量的、简单的、基于 XML 的协议,它被设计成在 WEB 上交换结构化的信息。 SOAP 可以和现存的许多因特网协议和格式结合使用,包括超文本传输协议( HTTP),简单邮件传输协议(SMTP),多用途网际邮件扩充协议(MIME)。它还支持从消息系统到远程过程调用(RPC)等大量的应用程序。
WIKIPEDIA : SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on XML for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.
简单对象访问协议(SOAP)是W3C组织的一个Note, 它描述了一种在分散的或分布式的环境中如何交换信息的轻量级协议。SOAP是一个基于XML的协议,它包括三个部分:SOAP封装(Envelop),封装定义了一个描述消息中的内容是什么,是谁发送的,谁应当接受并处理它以及如何处理它们的框架;SOAP编码规则(Encoding Rules),用于表示应用程序需要使用的数据类型的实例;SOAP RPC表示(RPC Representation),表示远程过程调用和应答的协定;SOAP可以和多种传输协议绑定(Binding),使用底层协议交换信息。
SOAP 消息基本上是从发送端到接收端的单向传输,但它们常常结合起来执行类似于请求 / 应答的模式。所有的 SOAP 消息都使用 XML 编码。一条 SOAP 消息就是一个包含有一个必需的 SOAP 的封装包,一个可选的 SOAP 标头和一个必需的 SOAP 体块的 XML 文档。
SOAP在HTTP协议的基础上时,把编写成XML的REQUEST参数, 放在HTTP BODY上提交给WEB SERVICE服务器(SERVLET,ASP什么的) 处理完成后,结果也写成XML作为RESPONSE送回用户端, 为了使用户端和WEB SERVICE可以相互对应,可以使用WSDL作为这种通信方式的描述文件,利用WSDL工具可以自动生成WS和用户端的框架文件,SOAP具备把复杂对象序列化*到XML里去的能力。
SOAP也可以绑定到TCP和UDP协议上。
WSDL
WSDL describes what a web service does, what methods it contains, what parameters and types it knows how to use, and which ports it is using for communication. The WSDL defines the valid contents of the XML messages to be passed over SOAP. The WSDL acts as a specification, like IDL, to describe the interfaces and parameters on a web service. The methods available are usually grouped together in a "port", which can be thought of as a view to web services where different operations are exposed. A WSDL can contain one or more ports.
关系总结
总之SOAP是一个结构化数据交换的一个协议规范,用于WebService。SOAP基于XML,由于HTTP协议的应用广泛支持(协议支持和80端口可达),多数SOAP应用是基于HTTP的。
SOAP是消息栈中位于HTTP协议之上的一层,Service调用达服务器后,TCP/IP层面,HTTP层面,SOAP协议层面依次逐级获取各自的Payload,程序结合WSDL描述的WebService结构信息,最终生成/得到相应的对象,发起调用。