webservice 的wsdl文件详解
转
WSDL(Web Service Description Language)Web服务描述语言
################################################################################
适用于描述WebService的文档格式
下面例子是为了输入一个字符串name,返回一个SayHello的操作。
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
targetNamespace="http://com.liuxiang.xfireDemo/HelloService"-------------------DEFINITIONS:WSDL文档根元素,提供命名空间
xmlns:tns="http://com.liuxiang.xfireDemo/HelloService"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>---------------------------------------TYPE:数据类型定义的容器,TYPE定义了两个元素,一个是sayHello,一个是sayHelloResp
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="qualified" elementFormDefault="qualified"
onse。
targetNamespace="http://com.liuxiang.xfireDemo/HelloService">
<xsd:element name="sayHello">----------------------------------------sayHello
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1"
name="name" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sayHelloResponse">---------------------------sayHelloResponse
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1"
name="out" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="sayHelloResponse">------------------------------------MESSAGE:通信消息的数据结构的抽象化定义,描述了Web服务使用消息的有效负载,
还可描述输出或接受消息的有效负载 ,其中ELEMENT对应TYPE中的NAME。定义元素的方式取决于使用RPC样式或文档样式,此处为文档样式
<wsdl:part name="parameters" element="tns:sayHelloResponse" />
</wsdl:message>
<wsdl:message name="sayHelloRequest">
<wsdl:part name="parameters" element="tns:sayHello" />
</wsdl:message>
<wsdl:portType name="HelloServicePortType">------------------------------------------PORTTYPE:对于某个访问入口点类型所支持的操
<wsdl:operation name="sayHello"> 作的抽象集合,一个portType可定义多
<wsdl:input name="sayHelloRequest"
个operation,一个operation可看做一
message="tns:sayHelloRequest" />
个方法,请求消息是MESSAGE定义的
<wsdl:output name="sayHelloResponse"
sayHelloRequest,相应消息是
message="tns:sayHelloResponse" />
sayHelloResponse,同时包含input
</wsdl:operation>
/output表明这是一个请求/响应模式,
</wsdl:portType>
input表示传递到Web服务的有效负
载,output表示传递到客户的有效负
载.此处TNS为DEFINITIONS中所声
明。
<wsdl:binding name="HelloServiceHttpBinding"--------------------------------------------BINDING:特定端口类型的具体协议和数据格式规
type="tns:HelloServicePortType">
范的绑定,binding将一个抽象porType映
<wsdlsoap:binding style="document"
射到一组具体协议(SOAP/HTTP),消息传
transport="http://schemas.xmlsoap.org/soap/http" />
递样式,编码样式.
<wsdl:operation name="sayHello">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="sayHelloRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">----------------------------------------------------------SERVICE:相关服务访问点的集合,一个service元
<wsdl:port name="HelloServiceHttpPort"
素包含多个不同的port,每个port表示
binding="tns:HelloServiceHttpBinding">
不同的Web服务,此例子中提供给访
<wsdlsoap:address
问你的地址为:http://localhost:8080/xf.
location="http://localhost:8080/xfire/services/HelloService" />
.....
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
IMPORT:可以让当前WSDL文档中引用其他WSDL文档中指定命名空间中的元素,通常用于WSDL模块化。
<wsdl:import namespace="http://xxx.xxx.xxx/xxx/xxx" location="http://xxx.xxx.xxx/xxx/xxx.wsdl"/>
namespace属性:必须与所导入文件的targetNameSpace名称相同.
location属性:指向wsdl文件的路径,不能为空.
附WSDL文档结构图-------

webservice 的wsdl文件详解的更多相关文章
- WebService核心之WSDL深入详解
WebService核心之WSDL深入详解 根据上一篇文章开发的Web Service实例生成的WSDL文档如下: XML里两个属性介绍: targetNamespace 相当于ja ...
- web.xml文件详解
web.xml文件详解 Table of Contents 1 listener. filter.servlet 加载顺序 2 web.xml文件详解 3 相应元素配置 1 listener. f ...
- Linux中/proc目录下文件详解
转载于:http://blog.chinaunix.net/uid-10449864-id-2956854.html Linux中/proc目录下文件详解(一)/proc文件系统下的多种文件提供的系统 ...
- SUBLIME TEXT 2 设置文件详解
SUBLIME TEXT 2 设置文件详解 Preferences.sublime-settings文件: // While you can edit this file, it’s best to ...
- [转]AndroidManifest.xml文件详解
转自:http://www.cnblogs.com/greatverve/archive/2012/05/08/AndroidManifest-xml.html AndroidManifest.xml ...
- delphi 资源文件详解
delphi资源文件详解 一.引子: 现在的Windows应用程序几乎都使用图标.图片.光标.声音等,我们称它们为资源(Resource).最简单的使用资源的办法是把这些资源的源文件打入软件包,以方便 ...
- VSFTPD全攻略(/etc/vsftpd/vsftpd.conf文件详解)
/etc/vsftpd/vsftpd.conf文件详解,分好类,方便大家查找与学习 #################匿名权限控制############### anonymous_enable=YE ...
- jni.h头文件详解二
作者:左少华 博客:http://blog.csdn.net/shaohuazuo/article/details/42932813 转载请注明出处:http://blog.csdn.net/shao ...
- 【转】 jni.h头文件详解(二)
原文网址:http://blog.csdn.net/shaohuazuo/article/details/42932813 作者:左少华 博客:http://blog.csdn.net/shaohua ...
随机推荐
- 9.2.1 hadoop mapreduce任务输出的默认排序
任务的默认排序 MapTask和ReduceTask都会默认对数据按照key进行排序,不管逻辑上是否需要.默认是按照字典顺序排序,且实现该排序的方法是快速排序.但是map和reduce任务只能保证单个 ...
- CH8 IO库
8.1 #include <iostream> #include <string> #include <sstream> #include <fstream& ...
- Nginx反向代理实现负载均衡配置图解
Nginx反向代理实现负载均衡配置图解 [导读] 负载均衡配置是超大型机器需要考虑的一些问题,同时也是数据安全的一种做法,下面我来介绍在nginx中反向代理 负载均衡配置图解,大家可参考本文章来操作. ...
- python绑定调用和非绑定调用
绑定调用和非绑定调用 在python中,绑定调用和非绑定调用其实是相对于类和实例来说的.抽象点说就是:在类实例化过程中,类的方法会绑定在实例之中,此时,这个实例会拥有这个类的具体属性和方法,这些属性和 ...
- NO18 linux开机自启动设置--开机流程--中文乱码--查看行数
第八题:装完系统后,希望让网络文件共享服务NES,仅在3级别上开机自启动,该如何做? 解答:什么是开机自启动,在Linux下软件服务随系统启动而启动的配置. 方法一:文件配置法,可以把要启动的服务的命 ...
- Tensorflow官方文档 input_data.py 下载
说明: 本篇文章适用于MNIST教程下载数据集. # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Ap ...
- P1080 MOOC期终成绩
1080 MOOC期终成绩 (25分) 对于在中国大学MOOC(http://www.icourse163.org/ )学习“数据结构”课程的学生,想要获得一张合格证书,必须首先获得不少于200分 ...
- 扩展的Sobel 算子
Custom Extended Sobel Filters https://arxiv.org/pdf/1910.00138.pdf sobel算子是进行边缘检测的一个重要算子.它通常是一个3x3的 ...
- elasticsearch-java客户端测试
1.环境准备 (1)添加依赖 <dependency> <groupId>org.elasticsearch.client</groupId> <artifa ...
- 041、Java中逻辑运算之普通或运算“|”
01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...