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文件详解的更多相关文章

  1. WebService核心之WSDL深入详解

    WebService核心之WSDL深入详解 根据上一篇文章开发的Web Service实例生成的WSDL文档如下: XML里两个属性介绍: targetNamespace          相当于ja ...

  2. web.xml文件详解

      web.xml文件详解 Table of Contents 1 listener. filter.servlet 加载顺序 2 web.xml文件详解 3 相应元素配置 1 listener. f ...

  3. Linux中/proc目录下文件详解

    转载于:http://blog.chinaunix.net/uid-10449864-id-2956854.html Linux中/proc目录下文件详解(一)/proc文件系统下的多种文件提供的系统 ...

  4. SUBLIME TEXT 2 设置文件详解

    SUBLIME TEXT 2 设置文件详解 Preferences.sublime-settings文件: // While you can edit this file, it’s best to ...

  5. [转]AndroidManifest.xml文件详解

    转自:http://www.cnblogs.com/greatverve/archive/2012/05/08/AndroidManifest-xml.html AndroidManifest.xml ...

  6. delphi 资源文件详解

    delphi资源文件详解 一.引子: 现在的Windows应用程序几乎都使用图标.图片.光标.声音等,我们称它们为资源(Resource).最简单的使用资源的办法是把这些资源的源文件打入软件包,以方便 ...

  7. VSFTPD全攻略(/etc/vsftpd/vsftpd.conf文件详解)

    /etc/vsftpd/vsftpd.conf文件详解,分好类,方便大家查找与学习 #################匿名权限控制############### anonymous_enable=YE ...

  8. jni.h头文件详解二

    作者:左少华 博客:http://blog.csdn.net/shaohuazuo/article/details/42932813 转载请注明出处:http://blog.csdn.net/shao ...

  9. 【转】 jni.h头文件详解(二)

    原文网址:http://blog.csdn.net/shaohuazuo/article/details/42932813 作者:左少华 博客:http://blog.csdn.net/shaohua ...

随机推荐

  1. 「NOIP2013」华容道

    传送门 Luogu 解题思路 预支一点东西: 这题其实有着更为思维的图模型,还十分考验码力,不简单啊 这居然是联赛题 讲正解: 显然我们对于一种合法方案,空格子肯定是一直围绕着特定棋子反复横跳的. 所 ...

  2. 「JSOI2007」建筑抢修

    传送门 Luogu 解题思路 显然先把所有楼按照报废时间递增排序. 然后考虑 \(1\cdots i-1\) 都能修完, \(i\) 修不完的情况. 显然我们在这 \(i\) 个里面至多只能修 \(i ...

  3. Mongo2Go 介绍

    Mongo2Go(https://github.com/Mongo2Go/Mongo2Go )是最新的MongoDB二进制文件的托管包装, 它针对.NET Standard 1.6(对于.NET 4. ...

  4. 南邮CG-CTF Web记录

    MYSQL(利用精度,传参为小数) robots.txt中的代码: <?php if($_GET[id]) { mysql_connect(SAE_MYSQL_HOST_M . ':' . SA ...

  5. mysql文件理解

    mysql_Innodb的undo_log和redo_log 原创 2014年10月28日 11:26:34   众所周知,mysql支持多种存储引擎,现在常用的是MyISAM和InnoDB.MyIS ...

  6. LINQ -- 匿名类型

    匿名类型注意事项: 匿名类型只能和局部变量配合使用,不能用于成员. 由于匿名类型没有名字,我们必须使用var关键字作为变量类型. 不能设置匿名类型对象的属性.编译器为匿名类型穿件的属性是只读的. 除了 ...

  7. Vuex - state , getters , mutations , actions , modules 的使用

      1, 安装   vue add vuex 2, 安装完之后会自动生成store文件夹,并在main.js中自动引用 store/index.js 3,在store文件夹下的index.js中定义 ...

  8. Manacher算法[O(n)]

    问题描述: 输入一个字符串,求出其中最大的回文子串.子串的含义是:在原串中连续出现的字符串片段.回文的含义是:正着看和倒着看相同,如abba和yyxyy. 算法基本要点: 首先用一个非常巧妙的方式,将 ...

  9. 微信公众号sdk

    微信公众号开发 能享用微信公众号的API,比如分享给好友,分享到朋友圈,禁止菜单功能,选择图片,获取地址,以及支付 微信的功能有两种执行方式 一种是 wx.xx 一种是 WeixinJSBridge. ...

  10. 010、Java中扩大数据类型

    01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...