一个完整的WSDL文档及各标签详解
<?xml version="1.0" encoding="UTF8" ?>
<wsdl:definitions targetNamespace="http://www.57market.com.cn/HelloService" xmlns:soapenc12="http://www.w3.org/2003/05/soapencoding" xmlns:tns="http://www.57market.com.cn/HelloService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://www.w3.org/2003/05/soapenvelope">
/**
* type元素,定义了交换信息的数据格式。
* 为了实现最大的互操作性(interoperability)和平台中立性(neutrality),WSDL选用XML Schema DataTypes
* 简称XSD作为标准类型系统,并将它作为固有类型系统。
* 下面是数据定义部分,该部分定义了两个元素,一个是sayHello,一个是sayHelloResponse:
* sayHello:定义了一个复杂类型,仅仅包含一个简单的字符串,将来用来描述操作的参入传入部分;
* sayHelloResponse:定义了一个复杂类型,仅仅包含一个简单的字符串,将来用来描述操作的返回值;
*/
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.57market.com.cn/HelloService">
<xsd:element name="sayHello">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="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>
/**
* message元素指定XML 数据类型组成消息的各个部分。message元素用于定义操作的输入和输出参数。
* 该部分是信息格式的抽象定义:定义了两个消息sayHelloResponse和sayHelloRequest:
* sayHelloRequest:sayHello操作的请求消息格式,由一个消息片断组成,名字为parameters,
* 元素是我们前面定义的 types中的元素;
* sayHelloResponse:sayHello操作的响应消息格式,由一个消息片断组成,名字为parameters,
* 元素是我们前面定义 *的types中的元素;
* 如果采用RPC样式的消息传递,只需要将文档中的element元素应以修改为type即可。
*message:用來定義消息的結構
*part:指定引用types中定義的標籤片斷
*/
<wsdl:message name="sayHelloRequest">
<wsdl:part name="parameters" element="tns:sayHello" />
</wsdl:message>
<wsdl:message name="sayHelloResponse">
<wsdl:part name="parameters" element="tns:sayHelloResponse" />
</wsdl:message>
/**
* portType元素中定义了Web服务的操作。操作定义了输入和输出数据流中可以出现的XML消息。
* 一些抽象操作的集合。每个操作关联一个输入消息和一个输出消息。
* portType定义了服务的调用模式的类型,这里包含一个操作sayHello方法,同时包含input和output表明
* 该操作是一个 请求/响应模式,请求消息是前面定义的sayHelloRequest,
* 响应消息是前面定义的 sayHelloResponse。input表示传递到Web服务的有效负载,
* output消息表示传递给客户的有效负载。
*portType:用來定義服務端的SEI
*operation:用來指定SEI中的處理請求的方法
*input:指定客戶端應用傳過來的數據,會引用上面的而定義的<message>
*output:指定服務端返回給客戶端的數據,會引用上面的而定義的<message>
*/
<wsdl:portType name="HelloServicePortType">
<wsdl:operation name="sayHello">
<wsdl:input name="sayHelloRequest" message="tns:sayHelloRequest" />
<wsdl:output name="sayHelloResponse" message="tns:sayHelloResponse" />
</wsdl:operation>
</wsdl:portType>
/**
* binding 元素描述特定服务接口的协议、数据格式、安全性和其它属性。
* 针对操作和portType中使用的消息指定实际的协议和数据格式规范。
*binding:用於定義SEI的實現類
*type屬性:引用上面的<portType>
*<soap:operation style="document" /> 綁定的數據是一個document(xml)
*operation:用來定義實現的方法
*<soap:operation style="document" /> 傳輸的是document(xml)
*input:指定客戶端應用傳過來的數據
*<soap:body use="literal" />:文本數據
*output:指定服務器端返回客戶端的數據
*<soap:body use="literal"/>:文本數據
*/
<wsdl:binding name="HelloServiceHttpBinding" type="tns:HelloServicePortType">
<wsdlsoap:binding style="document" 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>
/**
* service元素。服务元素包含一组port元素。端口将端点与来自服务接口定义的binding 元素关联起来。
* port指定一个绑定的地址,这样定义一个通信的终端。
*service:一個webservice的容器
*name:屬性:它用以指定一個服務器端處理請求的入口(就是SEI的實現)
* binding屬性:引用上面定義的<binding>
*address:當前webservice的請求地址
*/
<wsdl:service name="HelloService">
<wsdl:port name="HelloServiceHttpPort"binding="tns:HelloServiceHttpBinding">
<soap:address location="http://localhost:8080/xfire/services/HelloService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
一个完整的WSDL文档及各标签详解的更多相关文章
- elasticsearch系列三:索引详解(分词器、文档管理、路由详解(集群))
一.分词器 1. 认识分词器 1.1 Analyzer 分析器 在ES中一个Analyzer 由下面三种组件组合而成: character filter :字符过滤器,对文本进行字符过滤处理,如 ...
- 使用vs code编写Markdown文档以及markdown语法详解
首先安装vscode工具,下载地址如下: https://code.visualstudio.com/ 在vs code的扩展中安装: Markdown Preview Enhanced 这款插件,安 ...
- MongoDB开发深入之一:文档数据关系模型详解(一对多,多对多)
文档关联模型通常有3种方式: 嵌入式(一对一.一对多) 后期手动统一ID处理(一对多.多对多) References引用(一对一.一对多) 文档树模型通常有3种方式: 父引用(Parent Refer ...
- 逆向分析一个完整的C++程序包含寄存器与参数传递详解
最近在分析C++ dump 文件的时候觉得有必要将一些必要的反汇编东西总结一下以备别人参考,自己有时间的时候也可以进行更多的改进.下面通过一个简单的C++代码转成汇编代码后的详细解释说明一下C++和汇 ...
- 文档学习 - UILabel - 属性详解
#import "ViewController.h" @implementation ViewController - (void)viewDidLoad { [super vie ...
- 利用wsdl.exe自动将wsdl文档转换为C#代码
1.获取完整的wsdl文档 获取下面这个博客中提到的wsdl http://www.cnblogs.com/LCCRNblog/p/3716406.html 将获取到的wsdl放到一个文本中,改后缀( ...
- WSDL 文档-一个简单的 XML 文档
WSDL 文档是利用这些主要的元素来描述某个 web service 的: <portType>-web service 执行的操作 <message>-web service ...
- 最近学习工作流 推荐一个activiti 的教程文档
全文地址:http://www.mossle.com/docs/activiti/ Activiti 5.15 用户手册 Table of Contents 1. 简介 协议 下载 源码 必要的软件 ...
- WSDL 文档解析
学习webservice,就离不了WSDL文档,他是我们开发WebService的基础,虽说,现在现在有许多WebService的开源框架使得我们可以根据WSDL生成客户端代码,但是,了解WSDL文档 ...
随机推荐
- 《Out of control》阅读笔记(一)
Out Of Control 说实话,当初买这本书起源于知乎诸位学问人的推荐,脑子一热就买了.为了不浪费这几十块钱,细致了看完了前三章,买来一看才发现原来这本书居然跟计算机有很深刻的关系.其实更准确地 ...
- [JS] jQuery选择器
jQuery 选择器 选择器 实例 选取 * $("*") 所有元素 #id $("#lastname") id=lastname 的元素 .class $(& ...
- java switch语句注意的事项
1.switch语句使用的变量只能是byte.char.short.string数据类型. 2.case后面gender数据必须是一个常量. 3.switch的停止条件: switch语句一旦比配上了 ...
- JS Array ECMAScript5 Methods
JavaScript 的新版本(ECMAScript 5)中,为数组新增了一些方法.这些方法包括: forEach(f [,o]): 此方法类似于for/in循环,其作用是遍历整个数组并执行函数的某些 ...
- 与众不同 windows phone (52) - 8.1 新增控件: AutoSuggestBox, ListView, GridView, SemanticZoom
[源码下载] 与众不同 windows phone (52) - 8.1 新增控件: AutoSuggestBox, ListView, GridView, SemanticZoom 作者:webab ...
- spring的懒加载
在spring的IOC容器中,可以通过设置<beans default-lazy-init="XXX"></beans>来设置是否为懒加载模式,懒加载的意思 ...
- PowerDesigner工具箱(palette)如何打开
我使用的PowerDesigner是15.1版本的,其他版本的操作可能会有所不同 我们在使用PowerDesigner的时候,有时候可能会不小心把悬浮的工具箱隐藏掉,就是下面这个东西 怎么显示出来呢, ...
- 容器--Collection和AbstractCollection
一.前言 容器是JAVA中比较重要的一块,整个体系设计得非常好,同时对于代码学习来说也是比较好的范例.同时很多面试官也比较喜欢用容器来考察面试者的基础知识,所以掌握好容器还是比较重要的.本文主要总结一 ...
- 【poj 3461】Oulipo(字符串--KMP)
题意:求子串在文本串中出现了多少次. 解法:使用KMP的next[ ]和tend[ ]数组计数. #include<cstdio> #include<cstdlib> #inc ...
- Laravel Predis Error while reading line from the server.
问题 Laravel说明文档中的 Redis 发布与订阅案例,命令行运行php artisan redis:subscribe 到60s自动断开并报错 [Predis\Connection\Conne ...