Web Services的相关名词解释:WSDL与SOAP

在对Web Services进行性能测试时,接触到最多的两个名词就是WSDL和SOAP。利用LoadRunner对Web Services进行调用的时候,也存在两种常用方法,即基于WSDL的【Add Service Call】和基于SOAP的【Import SOAP】,在本站中已有两篇文章分别对其进行了详细介绍。

对于不了解Web Services的朋友,可能刚开始的时候会一头雾水,不明白WSDL和SOAP之间的联系,从而难以理解两种测试方法之间的区别。

实际情况是,WSDL与SOAP只是Web Services的两大标准,它们之间并没有必然的联系。

我们可以先比较一下较为官方的名词解释。

如下是W3C上关于WSDL的解释。

WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate.

如下是wikipedia上关于SOAP的解释。

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 Information Set for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

对比两者的详细解释,可以得出针对于Web Services:

  • WSDL描述的是服务本身,它以machine-readable的形式对外界描述了该Web Services提供的服务接口,包括Service的名称,调用Service时需要传入的参数类型和格式,以及返回的数据结构。另外,它还以message formats和network protocols无关的形式对网络传输进行了描述。
  • SOAP本身就是一种通信协议,利用它以WSDL定义的形式对Service的调用方式进行描述,包括调用的具体Service名称、参数名称和参数数值。
  • 对于Web Services来说,WSDL是必须的,而SOAP只是通信协议中较为常用的一种,可以用其它通信协议代替;例如可以直接采用HTTP GET/POST的形式对Web Services进行调用,这对应了利用LoadRunner对Web Services进行调用的第三种方法,参见《利用web_custom_request函数构造Web Services请求》
posted @ 2013-08-05 10:16  龙佛热  阅读(442)  评论(0编辑  收藏  举报