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 ...
随机推荐
- 一种新的python局部调试手法
我们都知道,python里面可以用pdb来调试代码.但是pdb往往不大好用.有时候调试代码往往在多重条件里面,直接用pdb需要下条件断点,设定复杂的条件. 一个简单的办法就是这么干. __import ...
- angularJs-服务调用与后台数据获取
可以用factory做一些后台数据的获取,例如 happyFarm.factory('seedList',['$http',function($http){ return { ge ...
- shell命令、调度工具、后台执行线程和软连接
一.shell命令 1.后缀.sh 第一行需要加#!/bin/bash 没有的话,需呀sh 命令执行 示例test.sh: #!/bin/bash date ./test.sh 提示没有权限,此时,需 ...
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 按钮:按钮组
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- SciPy 积分
章节 SciPy 介绍 SciPy 安装 SciPy 基础功能 SciPy 特殊函数 SciPy k均值聚类 SciPy 常量 SciPy fftpack(傅里叶变换) SciPy 积分 SciPy ...
- NO21 Llinux的文件种类与扩展名--文件权限--软硬链接--Linux删除文件原理
Linux的文件种类与扩展名 一.文件种类:1.普通文件(regular file)第一个字符为[ - ]包括:①纯文本档(ASCII):这是Linux系统中最多的一种文件类型,称为纯文本档.是因为内 ...
- Windows下使用nginx问题
1.下载完成后,解压缩,运行cmd,使用命令进行操作,不要直接双击nginx.exe,不要直接双击nginx.exe,不要直接双击nginx.exe 一定要在dos窗口启动,不要直接双击nginx.e ...
- 005.Oracle数据库 , 查询多字段连接合并,并添加文本内容
/*Oracle数据库查询日期在两者之间*/ SELECT PKID , OCCUR_DATE, PKID || ' 曾经沧海难为水 ' ||TO_CHAR( OCCUR_DATE, ' yyyy/m ...
- 虚拟机下安装Maven
1.首先需要下载maven安装包(我下载的是apache-maven-3.5.3版本) 官网下载:http://maven.apache.org/download.cgi 2.将压缩包放到虚拟机下(我 ...
- win2008R2 局域网共享
1.解决windows server 2008 R2 不能开启网络发现 开始–>管理工具–>服务,以下3个服务选择自动.开启: Function Discovery Resource Pu ...