Web Service, SOAP和WSDL的关系

最近项目做的东西比较多,一个不做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结构信息,最终生成/得到相应的对象,发起调用。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值