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 ...
随机推荐
- 106、Java中String类之使用contains()方法判断子字符串是否存在
01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...
- 084、Java数组之实现数组复制
01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...
- 068、Java面向对象之声明两个对象
01.代码如下: package TIANPAN; class Book { // 定义一个新的类 String title; // 书的名字 double price; // 书的价格 public ...
- Docker registry自签名证书
权威Registry 获取安全证书有两个办法:互联网认证的CA处获取.自建CA自己给自己签名. 1.从认证CA处获取签名证书,大多数是需要付出一定费用的,近些年也有认证CA提供免费证书,例如Let’s ...
- 一、 SVN概述&工作方式&恢复历史版本
What why how 1 什么是SVN?作用是什么? SVN(SubVersion),版本控制系统.采用了分支管理系统,用于多人共同开发一个项目,共用资源的目的. 2 为什么要有SVN? 解决代码 ...
- Vue中 v-for 绑定key和不绑定key的区别
首先,它们区别主要在于 虚拟DOM的复用,绑定key可以更好的复用,下面来详细讲一下 假如我们有一个数组 arr = [1,2,3,4],我们要在2后面插入一个值9: 如果绑定了key值,那么会是这样 ...
- JAVA开源爬虫列表及简介
本文列举了一些较为常用的JAVA开源爬虫框架: 1.Apache Nutch 官方网站:http://nutch.apache.org/ 是否支持分布式:是 可扩展性:中.Apache Nutch并不 ...
- 03.swoole学习笔记--web服务器
<?php //创建web服务器 $serv=); //获取请求 /* * $request:请求信息 * $response:响应信息 */ $serv->on('request',fu ...
- mitmproxy 配置
pip install mitmproxy Man In The Middle 原理 mitmproxy工程工具包,主要包含了3个组件 功能一致,交互界面不同 mitmproxy:命令行界面,wind ...
- PHP使用ElasticSearch做搜索
PHP 使用 ElasticSearch 做搜索 https://blog.csdn.net/zhanghao143lina/article/details/80280321 https://www. ...