PortType
<wsdl:portType name="DeviceLookup">
<wsdl:operation name="retrieveDeviceByTac">
<wsdl:input message="tns:retrieveDeviceByTac" name="retrieveDeviceByTac">
</wsdl:input>
<wsdl:output message="tns:retrieveDeviceByTacResponse"
name="retrieveDeviceByTacResponse">
</wsdl:output>
<wsdl:fault message="tns:DeviceNotFoundException" name="DeviceNotFoundException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="retrieveAllDevices">
<wsdl:input message="tns:retrieveAllDevices" name="retrieveAllDevices">
</wsdl:input>
<wsdl:output message="tns:retrieveAllDevicesResponse"
name="retrieveAllDevicesResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
PorType 可描述一个 web service 、可被执行的操作,以及相关的消息。
端口定义了指向某个 web service 的连接点。可以把该元素比作传统编程语言中的一个函数库(或一个模块、或一个类),而把每个操作比作传统编程语言中的一个函数 。
[Roger: 确实, portType下面可以定义多个 operation]
WSDL binding
WSDL 绑定可为 web service 定义消息格式和协议细节。
<binding type="glossaryTerms" name="b1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation>
<soap:operation
soapAction="http://example.com/getTerm" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
SOAP binding
The formal set of rules for carrying a SOAP binding within or on top of another protocol (underlying protocol) for the purpose of exchange. Examples of SOAP bindings include carrying a SOAP message within an HTTP entity-body, or over a TCP stream.
soap binding 一般有两个参数 , style 和 transport 。
style 属性可取值 "rpc" 或 "document" 。在这个例子中我们使用 document 。
transport 属性定义了要使用的 SOAP 协议 , 在这个例子中我们使用 HTTP
<wsdl:service name="SyncCPFunctionTypeService">
<wsdl:port binding="tns:SyncCPFunctionTypeServiceSoapBinding" name="SyncCPFunctionTypePort">
<soap:address location="http://127.0.0.1:8080/mdcp/soap/SyncCPFunctionTypeSOAP"/>
</wsdl:port>
</wsdl:service>
An end point indicates a specific location for accessing a service using a specific protocol and data format.( [Roger:] protocol+data format 也就是 portType ,所以 endpoint 实际上就是 wsdl port ,而 wsdl port 就是 portType+soap address )
WSDL service : A collection of end points.