webservice 教程学习系列(八)——wsdl文档深入分析
首先上一下 sayHello.wsdl的源码
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. -->
<definitionsxmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/"name="HelloWSImplService"><types><xsd:schema><xsd:import namespace="http://ws/"schemaLocation="http://192.168.199.215:8989/ws_test/zq?xsd=1"></xsd:import></xsd:schema></types><message name="sayHello"><part name="parameters" element="tns:sayHello"></part></message><message name="sayHelloResponse"><part name="parameters" element="tns:sayHelloResponse"></part></message><portType name="HelloWSImpl"><operation name="sayHello"><input wsam:Action="http://ws/HelloWSImpl/sayHelloRequest"message="tns:sayHello"></input><output wsam:Action="http://ws/HelloWSImpl/sayHelloResponse"message="tns:sayHelloResponse"></output></operation></portType><binding name="HelloWSImplPortBinding" type="tns:HelloWSImpl"><soap:binding transport="http://schemas.xmlsoap.org/soap/http"style="document"></soap:binding><operation name="sayHello"><soap:operation soapAction=""></soap:operation><input><soap:body use="literal"></soap:body></input><output><soap:body use="literal"></soap:body></output></operation></binding><service name="HelloWSImplService"><port name="HelloWSImplPort" binding="tns:HelloWSImplPortBinding"><soap:address location="http://192.168.199.215:8989/ws_test/zq"></soap:address></port></service>
</definitions>
(1) types
<types><xsd:schema><xsd:import namespace="http://ws/"schemaLocation="http://192.168.199.215:8989/ws_test/zq?xsd=1"></xsd:import></xsd:schema></types>
在浏览器中输入:http://192.168.199.215:8989/ws_test/zq?xsd=1
可以看到其文件约束
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. --><xs:schema xmlns:tns="http://ws/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://ws/"> | |
<xs:element name="sayHello" type="tns:sayHello"></xs:element> | |
<xs:element name="sayHelloResponse" type="tns:sayHelloResponse"></xs:element> | |
<xs:complexType name="sayHello"> | |
<xs:sequence> | |
<xs:element name="arg0" type="xs:string" minOccurs="0"></xs:element> | |
</xs:sequence> | |
</xs:complexType> | |
<xs:complexType name="sayHelloResponse"> | |
<xs:sequence> | |
<xs:element name="return" type="xs:string" minOccurs="0"></xs:element> | |
</xs:sequence> | |
</xs:complexType> | |
</xs:schema> |
这个主要是约束了请求和响应的xml格式:
这个用于约束请求
<sayHello>
<arg0>string</arg0>
</sayHello>
这个用于约束响应
<sayHelloResponse>
<arg0>string</arg0>
</sayHelloResponse>
(2)message
<message name="sayHello"><part name="parameters" element="tns:sayHello"></part></message><message name="sayHelloResponse"><part name="parameters" element="tns:sayHelloResponse"></part></message>
message:用来定义消息的结构:一共就两个消息,一个请求消息,一个响应消息;
part:用来定义指定引用types中定义的标签片段;
(3)portType
<portType name="HelloWSImpl"><operation name="sayHello"><input wsam:Action="http://ws/HelloWSImpl/sayHelloRequest"message="tns:sayHello"></input><output wsam:Action="http://ws/HelloWSImpl/sayHelloResponse"message="tns:sayHelloResponse"></output></operation></portType>
portType 用来定义服务器的SEI;
operation :用来定义SEI中处理请求的方法;
input:指定客户端应用传过来的数据,会引用上面的message;
output:是指服务器端返回给客户端的数据,会引用上面的message;
(4)binding
<binding name="HelloWSImplPortBinding" type="tns:HelloWSImpl"><soap:binding transport="http://schemas.xmlsoap.org/soap/http"style="document"></soap:binding><operation name="sayHello"><soap:operation soapAction=""></soap:operation><input><soap:body use="literal"></soap:body></input><output><soap:body use="literal"></soap:body></output></operation></binding>
binding :用于定义SEI的实现类;
type:医用上面定义的portType标签;
operation :方法的具体实现;
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"></soap:binding>:用来指定使用xml文档传输
<soap:body use="literal"></soap:body>:是指客户端传过来的数据是文本数据
(5)service
<service name="HelloWSImplService"><port name="HelloWSImplPort" binding="tns:HelloWSImplPortBinding"><soap:address location="http://192.168.199.215:8989/ws_test/zq"></soap:address></port></service>
service :是服务器端的一个webservice容器
name属性:用来指定客户端容器类;
port:用来指定一个服务器端处理请求的入口,其实就是对应一个service服务的入口。
binding属性:引用上面的binding标签;
address:当前webservice的请求地址。
整体结构提如下所示:
webservice 教程学习系列(八)——wsdl文档深入分析相关推荐
- webservice学习01:wsdl文档结构
webservice学习01:wsdl文档结构 wsdl文档结构 WSDL文档示例 <wsdl:definitions xmlns:xsd="http://www.w3.org/200 ...
- webservice 教程学习系列(七)——编写天气预报和手机号码归属地的webservice
1.编写天气预报的webservice 首先我们在http://www.webxml.com.cn/zh_cn/index.aspx里面找到天气预报的url 然后找到获取地区天气的接口方法: 看到方法 ...
- sharepoint 2016 学习系列篇(23)-文档库应用篇-(5)文档权限配置
学习了关于文档的上传,下载,以及属性标签的应用,朋友们估计也会想到,前面学习到了关于列表的数据权限配置, sharepoint 2016 学习系列篇(15)-自定义列表应用篇-(4)数据权限配置 那么 ...
- sharepoint 2016 学习系列篇(24)-文档库应用篇-(6)文档版本控制
学习到这里,相信朋友们,应该是对文档库有了大概的认识.回顾一下,前面学习了一个 sharepoint 2016 学习系列篇(17)-自定义列表应用篇-(6)开启列表数据版本控制 那么对于文档来说,文档 ...
- sharepoint 2016 学习系列篇(19)-文档库应用篇-(1)创建一个文档库
前面学习了有关数据列表的知识,包括列表的创建,字段的创建,数据增删改查,以及权限,以及列表的数据展示设置,相信大家对sharepoint的列表应用,应该有了一个初步的了解及使用,在我们平时的应用中,除 ...
- JavaScript学习系列6 充实文档的内容
JavaScript 两项基本原则 渐进增强:你应该总是从最核心的部分,也就是从内容开始.应该根据内容使用标记实现良好的结构:然后再逐步加强这些内容. 平稳退化:不支持JavaScript也能访问基本 ...
- sharepoint 2016 学习系列篇(21)-文档库应用篇-(3)在文档库中上传文档和下载文档
在文档库中,上传文档到文档库中,有一下几种方式: 第一种,通过文档库页面,点击上载: 点击"浏览",选择需要上载的文件,点击确定 第二种,通过文档库页面,拖文档的方式上载: 在电脑 ...
- webservice 教程学习系列(一)——schema约束
最近同事在做一个webservice 接口的调用,我比较感兴趣,所以就找时间学习了一下.在此写下我学习的全过程,算是记个笔记吧!如有不足或者错误之处,欢迎指摘. 因为大部分的webservice是通过 ...
- webservice的WSDL文档详解
WSDL – WebService Description Language – Web服务描述语言. –通过XML形式说明服务在什么地方-地址 –通过XML形式说明服务提供什么样的方法 – 如何调用 ...
- WebService --WSDL文档解析
通俗的讲:WSDL文档描述了Web Service如下3个方面: WHAT--该 Web Service包含"什么"操作 HOW--该 Web Service的操作应该" ...
最新文章
- 怼完Sophia怼深度学习!细数完大神Yann LeCun 这些年怼过的N件事,原来顶级高手是这样怼人的...
- dell存储Linux配置,Dell MD3200远程存储的特殊配置
- 在线教育开源 java_开源项目SpringBoot在线教育平台
- msf实战提权windows_ATTamp;CK实战 | 红队评估一(上)
- Win10开启Administrator超级管理员账户
- Windows Server 2008 R2Cisco2960 配置Radius服务 实现802.1x认证 实战
- 灵活运用 SQL SERVER FOR XML PATH
- 前端调试你还在console.log吗,那你就out, debugger那么好用,你都不用呀
- 64位程序如何调用32位dll(简单解决方案 )
- c语言求同构数的三个步骤,C语言求同构数.doc
- Entity Framework Core系列教程-1
- jetbrains DataGrip 1.0注册破解方法
- 用iPad开发iPhone App,苹果发布Swift Playgrounds 4
- python 日历节假日显示颜色_python判断2018/2019年的某天是否是节假日
- 超详细分解c 语言——实现扫雷游戏(详解)
- 项目管理的3个关键动作:启动、推进、复盘
- 说中台,以正本清源之名
- mac删除自带的 ABC 输入法
- 露点温度 海平面气压 场面气压 计算公式 类
- android4以下的音乐播放器,Android平台四大音乐播放器对比评测
热门文章
- fluent p1模型_FLUENT基本物理模型介绍
- VB.net 研华IO卡1762的编程方法 控件方法 VS2010专业版
- cad批量打印_CAD如何进行批量打印图纸
- pyecharts导出矢量图
- 如何用python解码base32/base64
- html改excel,怎么把html文件转成excel:html表格如何转换excel
- python 通配符用法,python - 通配符
- python数据平滑处理,numpy之数据平滑处理
- 计算机网络软考英语题,计算机软考网络工程师必备英语词汇全集(中级)
- 在HTML文字标签i什么效果,html的i标签有什么作用