蓝色天空.知识 · 实践 · 创造
我的收藏
W3C 教程目录 16章
W3C / LEARN BY DOING

W3C与 WSDL:服务描述、历史草案和2.0

保留1.1、1.2、2.0全部部件及架构资料,纠正记录与推荐混淆。

学完这一章,你能够

  • 保留1.1、1.2、2.0全部部件及架构资料,纠正记录与推荐混淆。
  • 保留1.1、1.2、2.0全部部件及架构资料,纠正记录与推荐混淆。

描述服务不是服务执行

WSDL以XML描述接口、消息/类型、绑定和端点;它不自动部署服务器、访问数据库或替用户完成调用。Web服务器/数据库/网关是一种应用架构,不是WSDL本身强制要求单独一台机器。

历史版本与工作范围

WSDL1.1 Note、Usage Scenarios、Requirements、Architecture、Glossary及后续场景资料保留;WSDL1.2的Core/Message Patterns/Bindings是历史草案路线,不能称最新。

WSDL2.0已有2007年的发布,包括Primer、Core、Adjuncts、SOAP1.1 Binding和RDF Mapping;不同部件可能是Note或资料性内容,不能把日期相同全算成规范性推荐。

地址和架构关联

WS-Addressing Core/SOAP Binding与Web Architecture各自有文档,不把它们改名成WSDL的私有语法。1.1的message/portType/port与2.0的interface/endpoint等不能混用一个命名空间。

本例只在自有描述里核对QName引用、接口/绑定/服务/端点关系;真实远程调用、数据库和企业网关部署不以文档结构验证代替。

历史规范逐项时间线(日期和阶段对应指定历史版本)

规范条目官方版本名日期当时阶段指定版本地址
WSDL 1.1 NoteWeb Services Description Language (WSDL) 1.12001-03-15Notehttps://www.w3.org/TR/2001/NOTE-wsdl-20010315
WSDL Usage ScenariosWeb Service Description Usage Scenarios2002-06-04Retiredhttps://www.w3.org/TR/2002/WD-ws-desc-usecases-20020604/
WSDL RequirementsWeb Services Description Requirements2002-10-28Retiredhttps://www.w3.org/TR/2002/WD-ws-desc-reqs-20021028/
WSDL ArchitectureWeb Services Architecture2004-02-11Notehttps://www.w3.org/TR/2004/NOTE-ws-arch-20040211/
WSDL GlossaryWeb Services Glossary2004-02-11Notehttps://www.w3.org/TR/2004/NOTE-ws-gloss-20040211/
WSDL Usage ScenariosWeb Services Architecture Usage Scenarios2004-02-11Notehttps://www.w3.org/TR/2004/NOTE-ws-arch-scenarios-20040211/
WSDL 1.2 Core LanguageWeb Services Description Language (WSDL) Version 1.2 Part 1: Core Language2003-06-11Working Drafthttps://www.w3.org/TR/2003/WD-wsdl12-20030611
WSDL 1.2 Message PatternsWeb Services Description Language (WSDL) Version 1.2 Part 3: Bindings2003-06-11Working Drafthttps://www.w3.org/TR/2003/WD-wsdl12-bindings-20030611
WSDL 1.2 BindingsWeb Services Description Language (WSDL) Version 1.2 Part 3: Bindings2003-06-11Working Drafthttps://www.w3.org/TR/2003/WD-wsdl12-bindings-20030611
WSDL 2.0 PrimerWeb Services Description Language (WSDL) Version 2.0 Part 0: Primer2007-06-26Recommendationhttps://www.w3.org/TR/2007/REC-wsdl20-primer-20070626/
WSDL 2.0 Core LanguageWeb Services Description Language (WSDL) Version 2.0 Part 1: Core Language2007-06-26Recommendationhttps://www.w3.org/TR/2007/REC-wsdl20-20070626/
WSDL 2.0 AdjunctsWeb Services Description Language (WSDL) Version 2.0 Part 2: Adjuncts2007-06-26Recommendationhttps://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/
WSDL 2.0 SOAP 1.1 BindingWeb Services Description Language (WSDL) Version 2.0 SOAP 1.1 Binding2007-06-26Notehttps://www.w3.org/TR/2007/NOTE-wsdl20-soap11-binding-20070626/
WSDL 2.0 RDF MappingWeb Services Description Language (WSDL) Version 2.0: RDF Mapping2007-06-26Notehttps://www.w3.org/TR/2007/NOTE-wsdl20-rdf-20070626/
Web Services Addressing CoreWeb Services Addressing 1.0 - Core2006-05-09Recommendationhttps://www.w3.org/TR/2006/REC-ws-addr-core-20060509/
Web Services Addressing SOAP BindingWeb Services Addressing 1.0 - SOAP Binding2006-05-09Recommendationhttps://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/
Web ArchitectureArchitecture of the World Wide Web, Volume One2004-12-15Recommendationhttps://www.w3.org/TR/2004/REC-webarch-20041215/

概念、用途与有效条件

术语/形式含义及用途边界
definitions/message描述根/消息本包1.1语法,与2.0不同
portType/operation抽象操作QName必须解析
binding/service/port绑定和地址地址存在不等于请求成功
WSDL1.1历史Note不能说所有版本都是REC
RDF Mapping2007 Note与核心REC出版角色区分

本章独立核心源码与验证步骤

含完整源码 · 11 行
展开查看收起
python
from mbsky_lab import *
def resolve(node,value):
 prefix,local=value.split(':',1);return node.nsmap[prefix],local
def run():
 tree=etree.parse(str(P/'data/service.wsdl'),xml_parser());root=tree.getroot();ns={'w':'http://schemas.xmlsoap.org/wsdl/','s':'http://schemas.xmlsoap.org/wsdl/soap/'};target=root.get('targetNamespace');binding=root.find('w:binding',ns);port=root.find('w:service/w:port',ns);kind=resolve(binding,binding.get('type'));bound=resolve(port,port.get('binding'));assert kind==(target,'LearningPort')and bound==(target,'LearningBinding');assert root.xpath('count(w:portType/w:operation/w:input)',namespaces=ns)==1
 for element in root.xpath('w:portType/w:operation/w:input|w:portType/w:operation/w:output',namespaces=ns):
  uri,name=resolve(element,element.get('message'));assert uri==target and root.xpath('count(w:message[@name=$name])',namespaces=ns,name=name)==1
 mapping=next(r for r in standards('w3c-wsdl')if r['label']=='WSDL 2.0 RDF Mapping');assert mapping['status']=='Note'
 return {'WSDL11_QName_references_resolve':True,'input_output_messages':2,'binding_to_interface_and_service_to_binding_checked':True,'endpoint':'http://127.0.0.1:8780/learning','endpoint_not_contacted':True,'WSDL20_RDF_mapping_status':'Note','not_full_WSDL_schema_or_service_conformance':True,'historical_rows':len(standards('w3c-wsdl'))}
if __name__=='__main__':emit('w3c-wsdl',run)

查看独立实例 ↗ 在独立页面查看源码、运行环境与工程包

  • 1.1消息、操作、绑定和端口QName关联成立;仅检查描述,不宣称端点运行。

本章附件与实例包

下载课程关联工程包:W3C

课程关联工程包(登记关联16章) · 含当前章节或实例 · mbskycom202611a441.zip

常见错误与边界检查

  • 将历史文档日期/阶段当作现行状态,或把REC所有段落误当规范性要求。
  • 用元数据/解析/局部运行代替整份规范语义验收及完整互操作性。

技术规范与官方资料

练习与参考解答

查看参考解答

对照指定版本、处理器、命名空间及失败条件,保持运行输入/输出/源码校验值对应。

SITE SEARCH

搜索教程、工具与资讯

热门搜索

JavaScriptJSON格式化正则表达式AI 编程AI 翻译AI导航专题标签
Esc 关闭

欢迎登录蓝色天空网

使用会员账号,继续你的学习