WebService WSDL结构分析

MathType 7.4保姆级安装教程:从下载到Word/WPS完美加载(附常见问题解决) 本文提供MathType 7.4的详细安装教程,涵盖从下载到Word/WPS完美加载的全过程,并附常见问题解决方案。特别针对科研写作中的公式编辑需求,介绍如何避免安装陷阱、配置Office集成及高效排版技巧,帮助用户快速掌握这一公式编辑神器。 阅读详情

WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似 远程过程调用)。WSDL 首先对访问的操作和访问时使用的请求/响应消息进行抽象描述,然后将其绑定到具体的传输协议和消息格式上以最终 定义具体部署的服务访问点。相关的具体部署的服务访问点通过组合就成为抽象的Web服务。 本文将详细讲解WSDL 文档的 结构 ,并分析每个元素的作用。

一:WSDL 定 义

    WSDL 是一个用于精确描述Web服务的文档,WSDL 文档是一个遵循WSDL XML模式的XML文档。WSDL 文档将Web服务定义为服务访问点或端口的集合。在 WSDL 中,由于服务访问点和消息的抽象定义已从具体的服务部署或数据格式绑定中分离出来,因此可以对抽象定义进行再次使用:消息,指对交换数据的抽象描述;而端 口类型,指操作的抽象集合。用于特定端口类型的具体协议和数据格式规范构成了可以再次使用的绑定。将Web访问地址与可再次使用的绑定相关联,可以定义一 个端口,而端口的集合则定义为服务。

   一个WSDL 文档通常包含7个重要的元素,即types、import、message、portType、 operation、binding、 service元素。这些元素嵌套在definitions元素中,definitions是WSDL 文 档的根元素。文章的下一部分将会详细介绍WSDL 的基本结构 。

二:WSDL 的 基本结构 -- 概述

如第一部分最后描述的那样,一个基本的WSDL 文档包含7个重要的元素。下面将分别介绍这几个元素以及他们的作用。

WSDL 文档在Web服务的定义中使用下列元素:

  • Types - 数据类型定义的容器,它使用某种类型系统(一般地使用XML Schema中的类型系统)。
  • Message - 通信消息的数据结构 的抽象类型化定义。使用Types所定义的类型 来定义整个消息的数据结构 。
  • Operation - 对服务中所支持的操作的抽象描述,一般单个Operation描述了一个访问入口的请求/响应消息对。
  • PortType - 对于某个访问入口点类型所支持的操作的抽象集合,这些操作可以由一个或多个服务访问点来支持。
  • Binding - 特定端口类型的具体协议和数据格式规范的绑定。
  • Port - 定义为协议/数据格式绑定与具体Web访问地址组合的单个服务访问点。
  • Service - 相关服务访问点的集合。

  可以参考下图来理解一下WSDL 的文档结构 图:WSDL文档元素的结构图

WSDL 的xml schema可以参照如下网址:http://schemas.xmlsoap.org/ wsdl /

三:WSDL 的 基本结构 -- 详述

本节将通过一个例子详细描述WSDL 文档每个元素的作用。下面一个例子是一个简单的WSDL 文档的内容,该文档的产生可 以参见我的另外一篇文章:xfire开发实例--HelloWorld篇  。

一个简单的Web Service的WSDL 文档,该服务支持名为sayHello的唯一操作,该操作通过在http上运行SOA P协议来实现的。该请求接受一个字符串 name,经过处理后返回一个简单的字符串。文档如下:

<? xml version="1.0" encoding="UTF-8"  ?>
< wsdl :definitions
    
targetNamespace ="http://com.liuxiang.xfireDemo/HelloService"
    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 >
        
< xsd:schema  xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
            attributeFormDefault
="qualified"  elementFormDefault ="qualified"
            targetNamespace
="http://com.liuxiang.xfireDemo/HelloService" >
            
< xsd:element  name ="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" >
                
< 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" >
        
< 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" >
        
< wsdl :operation  name ="sayHello" >
            
< wsdl :input  name ="sayHelloRequest"
                message
="tns:sayHelloRequest"   />
            
< wsdl :output  name ="sayHelloResponse"
                message
="tns:sayHelloResponse"   />
        
</ wsdl :operation >
    
</ wsdl :portType >
    
< 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 >
    
< wsdl :service  name ="HelloService" >
        
< wsdl :port  name ="HelloServiceHttpPort"
            binding
="tns:HelloServiceHttpBinding" >
            
< wsdlsoap:address
                
location ="http://localhost:8080/xfire/services/HelloService"   />
        
</ wsdl :port >
    
</ wsdl :service >
</ wsdl :definitions >

♦ types元素使用XML模式语言声明在WSDL 文档中的其他位置使用的复杂数据类型与元素;

♦ import元素类似于XML模式文档中的import元素,用于从其他WSDL 文档中导入WSDL 定 义;

♦ message元素使用在WSDL 文档的type元素中定义或在import元素引用的外部WSDL 文 档中定义的XML模式的内置类型、复杂类型或元素描述了消息的有效负载;

♦ portType元素和operation元素描述了Web服务的接口并定义了他的方法。portType元素和operation元素类似于 java接口和接口中定义的方法声明。operation元素使用一个或者多个message类型来定义他的输入和输出的有效负载;

♦ Binding元素将portType元素和operation元素赋给一个特殊的协议和编码样式;

♦ service元素负责将Internet地址赋给一个具体的绑定;

1、definitions元素

所有的WSDL 文档的根元素均是definitions元素。该元素封装了整个文档,同时通过其name提供了一个WSDL 文 档。除了提供一个命名空间外,该元素没有其他作用,故不作详细描述。

下面的代码是一个definitions元素的结构 :

< wsdl :definitions
    
targetNamespace ="http://com.liuxiang.xfireDemo/HelloService"
    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 :definitions >

2、types元素

 WSDL 采 用了W3C XML模式内置类型作为其基本类型系统。types元素用作一个容器,用于定义XML模式内置类型中没有描述的各种数据类型。当声明消息部分的有效负载 时,消息定义使用了在types元素中定义的数据类型和元素。在本文的WSDL 文档中的types定义:

 

< wsdl :types >
        
< xsd:schema  xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
            attributeFormDefault
="qualified"  elementFormDefault ="qualified"
            targetNamespace
="http://com.liuxiang.xfireDemo/HelloService" >
            
< xsd:element  name ="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" >
                
< 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 >

上面是数据定义部分,该部分定义了两个元素,一个是sayHello,一个是sayHelloResponse:

sayHello:定义了一个复杂类型,仅仅包含一个简单的字符串,将来用来描述操作的参入传入部分;

sayHelloResponse:定义了一个复杂类型,仅仅包含一个简单的字符串,将来用来描述操作的返回值;

3、import元素

import元素使得可以在当前的WSDL 文档中使用其他WSDL 文档中指定的命名空间中的定义元素。本例子 中没有使用import元素。通常在用户希望模块化WSDL 文档的时候,该功能是非常有效果的。

import的格式如下:

< wsdl :import  namespace ="http://xxx.xxx.xxx/xxx/xxx"  location ="http://xxx.xxx.xxx/xxx/xxx. wsdl " />

必须有namespace属性和location属性:

namespace属性:值必须与正导入的WSDL 文档中声明的targetNamespace相匹配;

location属性:必须指向一个实际的WSDL 文档,并且该文档不能为空。

4、message元素

message元素描述了Web服务使用消息的有效负载。message元素可以描述输出或者接受消息的有效负载;还可以描述SOA P文件头和错误detail元素的内容。 定义message元素的方式取决于使用RPC样式还是文档样式的消息传递。在本文中的message元素的定义,本文档使用了采用文档样式的消息传递:

< wsdl :message  name ="sayHelloResponse" >
        
< wsdl :part  name ="parameters"  element ="tns:sayHelloResponse"   />
    
</ wsdl :message >
    
< wsdl :message  name ="sayHelloRequest" >
        
< wsdl :part  name ="parameters"  element ="tns:sayHello"   />
    
</ wsdl :message >

该部分是消息格式的抽象定义:定义了两个消息sayHelloResponse和sayHelloRequest:

sayHelloRequest:sayHello操作的请求消息格式,由一个消息片断组成,名字为parameters,元素是我们前面定义的 types中的元素;

sayHelloResponse:sayHello操作的响应消息格式,由一个消息片断组成,名字为parameters,元素是我们前面定义的 types中的元素;

 如果采用RPC样式的消息传递,只需要将文档中的element元素应以修改为type即可。

5、portType元素

portType元素定义了Web服务的抽象接口。该接口有点类似Java的接口,都是定义了一个抽象类型和方法,没有定义实现。在WSDL 中, portType元素是由binding和service元素来实现的,这两个元素用来说明Web服务实现使用的Internet协议、编码方案以及 Internet地址。

一个portType中可以定义多个operation,一个operation可以看作是一个方法,本文中WSDL 文 档的定义:

     < 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 >

portType定义了服务的调用模式的类型,这里包含一个操作sayHello方法,同时包含input和output表明该操作是一个请求/响 应模式,请求消息是前面定义的sayHelloRequest,响应消息是前面定义的sayHelloResponse。input表示传递到Web服务 的有效负载,output消息表示传递给客户的有效负载。

6、binding

binding元素将一个抽象portType映射到一组具体协议(SOA O和HTTP)、消息传递样式、编码样 式。通常binding元素与协议专有的元素和在一起使用,本文中的例子:

     < 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 >

这部分将服务访问点的抽象定义与SOA P HTTP绑定,描述如何通过SOA P/HTTP来访问按照前面描述的访问入 口点类型部署的访问入口。其中规定了在具体SOA P调用时,应当使用的 soapAction是""。

具体的使用需要参考特定协议定义的元素。

7、service元素和port元素

service元素包含一个或者多个port元素,其中每个port元素表示一个不同的Web服务。port元素将URL赋给一个特定的 binding,甚至可以使两个或者多个port元素将不同的URL赋值给相同的binding。文档中的例子:

     < wsdl :service  name ="HelloService" >
        
< wsdl :port  name ="HelloServiceHttpPort"
            binding
="tns:HelloServiceHttpBinding" >
            
< wsdlsoap:address
                
location ="http://localhost:8080/xfire/services/HelloService"   />
        
</ wsdl :port >
    
</ wsdl :service >

这部分是具体的Web服务的定义,在这个名为HelloService的Web服务中,提供了一个服务访问入口,访问地址是http://localhost:8080/xfire/services/HelloService , 使用的消息模式是由前面的binding所定义的。

  本文简单介绍了WSDL 规范的用途,基本结构 和使用方法,希望对大家学习WSDL 有 帮助。

鸿蒙OpenHarmony南向开发 轻量系统芯片移植指南(一) OpenHarmony系统采用"系统>子系统>部件"层级架构,支持功能模块化裁剪。本文介绍了关键子系统及移植方法:1)启动恢复子系统负责内核到应用间的进程初始化,需配置启动入口标识及链接脚本;2)文件子系统提供基础文件操作接口,需适配HAL层文件读写功能,可通过Flash模拟、轻量文件系统或厂商自有方案实现。移植过程需修改config.json配置,添加对应组件定义及功能实现。系统采用模块化设计,开发者可根据实际需求灵活配置所需子系统功能。 阅读详情

相关推荐

Claude Code启动失败解决方案,执行文件不兼容一键修复

Claude Code命令行工具突然报错,显示"不支持的16位应用程序"。作者排查Node版本无果后,发现是Anthropic更新导致Windows兼容性问题。解决方法很简单:卸载旧版、切换npm镜像源、重装最新版即可恢复。经验教训:遇到类似问题应先搜索社区反馈,避免无谓排查,同时注意npm源使用后及时还原。整个踩坑过程虽折腾,但最终只是简单的重装问题。

1457

java调用WebService(一)

因工作需要和一个Sap相关系统以WebService的方式进行接口联调,之前仅听过这种技术,但并没有实操过,所以将本次开发相关的踩坑进行记录。

matinal 當冬夜漸暖 。公众号:matinal 3742

《实战指南 | MES业务顾问蓝图设计方案:避免90%项目踩坑,从战略到落地的全攻略》

《MES业务顾问蓝图设计方案》干货分享:制造业高管常遇MES系统沦为"摆设"的困境,根源在于蓝图设计阶段未抓准业务痛点。本文系统梳理了6大关键点:1)战略定位上承ERP下接设备;2)通过现场蹲点挖掘真实需求;3)构建可扩展技术架构;4)建立数据闭环管理;5)组织保障分步实施;6)持续量化KPI优化。方案强调从业务价值出发,避免"纸上谈兵",通过数据驱动实现"计划-执行-反馈"闭环,最终让MES成为企业数字化的核心资产。

「东哥说MES」 专注于MES制造执行系统,为你拆解核心架构、功能模块及与ERP/PLC的集成逻辑。提供从入门到精通的系列干货、精选行业报告与实用工具,构建你的数字化知识体系,关注我,用实战经验照亮你的数字化之路。 1334

Web Service描述语言 WSDL 详解(二)

七、数组  XSD提供&lt;list&gt;结构来声明一个数组,元素之间有空格界定。不过SOAP不是使用XSD来编码数组的,它定义了自己的数组类型--”SOAP-ENC: Array”。下列的例子揭示了从这一类型派生出一位整数数组的方法:&lt;xsd:complexType name=“ArrayOfInt”&gt;&lt;xsd:complexContent&gt; &lt;xsd:rest...

iushnauh的专栏 421

卡门涡街可视化实战:从网格加密策略到动画后处理技巧

本文详细介绍了利用ANSYS Fluent进行卡门涡街可视化模拟的全流程,包括网格加密策略、求解器设置、涡街捕捉及动画后处理技巧。通过计算流体力学(CFD)方法,帮助工程师和研究人员高效模拟圆柱绕流现象,优化工程设计。

weixin_29309785的博客 414

Axure RP9汉化+授权全攻略:从下载到激活一步到位(附最新授权码)

本文提供Axure RP9从下载安装到界面汉化的完整指南,帮助设计师和产品经理快速上手这款原型设计工具。详细讲解了如何安全获取软件、执行汉化操作、理解核心界面布局,并介绍了创建交互原型和生成HTML文件的基础步骤,助力用户高效开展设计工作。

cuda7parallel的博客 1141

接口测试之(二)WebService 之 WSDL文件 讲解

WebService 之 WSDL文件 讲解 恩,我想说的是,是不是经常有人在开发的时候,特别是和第三方有接口的时候,走的是SOAP协议,然后用户给你一个WSDL文件,说按照上面的进行适配,嘿嘿,这个时候,要是你以前没有开发过,肯定会傻眼,那如果你想学习的话,就认真的看下面的讲解咯: 一、WSDL概述 WebServices Description Language (...

ths512的博客 3244

Experion PKS系列开发:I_O模块_ExperionPKS与第三方I-O模块的集成

通过上述步骤,可以成功将第三方I/O模块集成到Honeywell Experion PKS系统中,实现对现场设备的监视和控制。集成过程中需要注意选择合适的第三方模块,配置正确的通信参数,编写正确的控制逻辑,并进行充分的测试,以确保系统的稳定性和可靠性。不同的通信协议(如Modbus、Profibus、Ethernet/IP、CANopen、OPC UA)有其独特的配置和编程方法,但总体流程相似。在实际应用中,根据项目需求选择合适的协议和模块,可以有效提高系统的灵活性和适应性。

zhubeibei168的博客 1101

XSD学习:超详细解析XSD中simpleType,complexType, simpleContent, complexContent

  前两天用了一下DOM4J,解析自己写的xml,但已经习惯了用各种提示来写xml文件,自己写还真不爽,就学了一下XSD。其中的simpleType,complexType,  simpleContent和complexContent标签,我一开始学得很迷,w3school上讲的太简单,网上的博客大概也都是复制粘贴,很少添加自己的理解,所以我真要吐槽一下网上那些博客帖(¥%*&amp;#&amp;...

↓ ↓ ↓ ↓ 2万+

芒果YOLOv10改进31:特征融合Neck篇:改进特征融合网络 BiFPN 结构,融合更多有效特征

YOLOv10改进:特征融合Neck篇:改进特征融合网络 BiFPN 结构,融合更多有效特征

包括YOLOv5、YOLOv7、YOLOv8等模型改进 684

AI Agent在智能广告投放中的应用

随着互联网的快速发展,广告投放市场变得越来越复杂和竞争激烈。传统的广告投放方式往往难以精准地触达目标受众,导致广告资源的浪费。AI Agent作为一种智能的自动化程序,能够在复杂的环境中自主学习、决策和执行任务。本文章的目的在于深入探讨AI Agent在智能广告投放中的应用,研究如何利用AI Agent提高广告投放的精准度、效率和效果,降低成本。范围涵盖了AI Agent的基本原理、相关算法、在广告投放中的具体应用场景以及实际案例分析等方面。

欢迎来到我的优快云空间!这里聚焦AI大模型应用实战,分享前沿技术、实战案例与开发经验。 617

wsdl详细说明

[color=red] [/color] ...

holyfirezfc0901的博客 726

四旋翼飞行器建模(一)

四旋翼飞行器的姿态运动学和姿态动力学建模方法。

加斯顿工程师的博客 686

【转】WebService WSDL结构分析

转载自:http://kalogen.javaeye.com/blog/418958 WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似远程过程调用)。WSDL首先对访问的操作和访问时使用的请求/响应消息进行抽象描述,然后将其绑定到具体的传输协议和消息格式上以最终定义具体部署的服务访问点。相关的具体.

sinolover的专栏 551

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

WebService WSDL结构分析 .

WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似远程过程调用)。WSD

jianchibuxie5的专栏 349

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Webservice —> WSDL文件结构分析

WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似远程过程调用)。WSDL首先对访问的操作和访问时使用的请求/响应消息进行抽象描述,然后将其绑定到具体的传输协议和消息格式上以最终定义具体部署的

devidh的专栏 588

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

WebService WSDL结构分析 http://blog.youkuaiyun.com/sunchaohuang/article/details/3076375

WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似远程过程调用)。WSDL首先对访问的操作和访问时使用的请求/响应消息进行抽象描述,然后将其绑定到具体的传输协议和消息格式上以最终定义具体部署的

rugaxm的专栏 698

Webservice_03_wsdl

WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务访问点对包含面向文档信息或面向过程调用的服务进行访问(类似远程过程调用)。WSDL首先对访问的操作和访问时使用的请求/响应消息进行抽象描述,然后将其绑定到具体的传输协议和消息格式上以最终定义具体部署的

Li-Chen的专栏 824

两天入门WebService

WebService总结 1、WebService是什么? 1.1 基于Web的服务,服务器端整出一些资源让客户端应用访问 1.2 一个跨语言、跨平台的规范 1.3 多个跨语言、跨平台的应用间通信整合的方案 2、几个重要术语 2.1 WSDL: WebService definition language 直译:WebService定义语言 1、对应一种类型的文件:.wsdl 2、定...

qq_41606459的博客 579

WebService培训教程

使用CXF开发web service 加入cxf的jar包即可,其它不需要改动 WebService请求深入分析 1). 分析WebService的WSDL文档结构 1.1). 实例截图 1.2). 文档结构 &lt;definitions&gt; &lt;types&gt; &lt;schema&gt; &lt;element&gt; ...

尚硅谷铁杆粉丝的博客 174
上一篇: 用XmlDocument创建XML文档
下一篇: 在Winform中发HTTP请求(调用WebService服务)
hh_longke
博客等级 码龄18年 5粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值