-- 作者:flyfoxs
-- 发布时间:6/28/2006 9:38:00 PM
-- WSDL中绑定元素<binding/>的一点不理解
有个问题不太明白。wsdl定义绑定时,定义了三种,分别是soap:binding,HTTP GET & POST Binding,MIME Binding 但是如何区别一个绑定是种一种呢,好像没有一个明显的属性或者元素来区分。你要结合多个元素来区分。比如下面是WSDL官方文档下面定义的三个Soap,http/post,mime绑定。 为什么不直接在<binding>元素里面添加一个属性,来表明这个绑定的类型呢?是不是我有什么知识没理解的,还是由于历史原因,搞成了现在这样? <binding name="StockQuoteSoap" type="tns:StockQuotePortType"> <soap:binding style="document" transport="http://example.com/smtp"/> <operation name="SubscribeToQuotes"> <input message="tns:SubscribeToQuotes"> <soap:body parts="body" use="literal"/> <soap:header message="tns:SubscribeToQuotes" part="subscribeheader" use="literal"/> </input> </operation> </binding> <binding name="b3" type="pt1"> <http:binding verb="POST"/> <operation name="o1"> <http:operation location="o1"/> <input> <mime:content type="application/x-www-form-urlencoded"/> </input> <output> <mime:content type="image/gif"/> <mime:content type="image/jpeg"/> </output> </operation> </binding> <binding name="b1" type="tns:pt1"> <operation name="GetCompanyInfo"> <soap:operation soapAction="http://example.com/GetCompanyInfo"/> <input> <soap:body use="literal"/> </input> <output> <mime:multipartRelated> <mime:part> <soap:body parts="body" use="literal"/> </mime:part> <mime:part> <mime:content part="docs" type="text/html"/> </mime:part> <mime:part> <mime:content part="logo" type="image/gif"/> <mime:content part="logo" type="image/jpeg"/> </mime:part> </mime:multipartRelated> </output> </operation> </binding>
|