< binding>和有什么区别?和< portType>在WSDL中? [英] What's the difference between <binding> and <portType> in WSDL?
问题描述
<binding>
和<portType>
似乎都定义了一个操作及其消息.我不太明白,为什么两者都必要?
portType (类似于Java界面)
- PortType是WSDL的抽象部分.
- 一个或多个端点支持的一组抽象操作.
绑定
- 绑定是WSDL的一个具体部分.
- 描述如何通过为操作和消息指定具体的协议和数据格式规范来调用操作.
-
绑定是三种类型 >
-
SOAP绑定:
SOAP绑定允许使用encoding
或literal
的document
或rpc
样式. 编码指示应如何以XML格式编码数据值(这些规则指定如何将某物"编码/序列化为XML,然后再从XML解码/反序列化为XML回到某物") . 文字是指根据模式对数据进行序列化(这只是纯XML数据).传输类型为http,jms,smtp ... -
> HTTP GET& POST绑定:
WSDL包括HTTP 1.1的GET和POST动词的绑定,以描述Web浏览器和网站之间的交互. -
MIME绑定: WSDL提供了一种将抽象类型绑定到某些MIME格式的具体消息的方法.
-
在WSDL 2.0中:
- 将端口类型重命名为接口
- 端口已重命名为端点
- 已删除的消息结构
Source >
有用的链接
Both <binding>
and <portType>
seem to define an operation and its message. I don't quite understand, why are they both necessary?
portType (Analogs to Java interface)
- PortType is an abstraction part of WSDL.
- An abstract set of operations supported by one or more endpoints.
binding
- Binding is an concrete part of WSDL.
- Describes how the operation is invoked by specifying concrete protocol and data format specifications for the operations and messages.
SOAP Binding:
SOAP binding allows eitherdocument
orrpc
style with eitherencoding
orliteral
. Encoding indicates how a data value should be encoded in an XML format (These rules specify how "something" is encoded/serialized to XML and then later decoded/de-serialized from XML back to "something"). Literal means that the data is serialized according to a schema (this is just plain XML data). With transportation type http, jms, smtp...HTTP GET & POST binding:
WSDL includes a binding for HTTP 1.1's GET and POST verbs in order to describe the interaction between a Web Browser and a web site.MIME binding: WSDL includes a way to bind abstract types to concrete messages in some MIME format.
In WSDL 2.0 :
- PortTypes renamed to interfaces
- Ports renamed to endpoints
- Removed message constructs
Useful links
- WSDL Reading, a Beginner's Guide
- W3C: Web Services Description Language (WSDL) 1.1
- W3C: Simple Object Access Protocol (SOAP) 1.1
这篇关于< binding>和有什么区别?和< portType>在WSDL中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!