<!--一次webservice调用,其实并不是方法调用,而是发送SOAP消息 ,即xml片段-->
<!--以上一篇中的wsdl文档为例,这里我将注释写到文档中 -->
<!--targetNamespace 相当于java中的package -->
<!--实际项目中应该会有wsdl:import标签,和java总的import概念是样的 -->
<!--xmlns相当于java中的import,里面的地址,和地址打开后里面的内容的targetNamespace是对应的 -->
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://hello.test.com/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
name="HelloWorldWS" targetNamespace="http://hello.test.com/">
<!--types里面是标准的xml文档 -->
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://hello.test.com/" elementFormDefault="unqualified"
targetNamespace="http://hello.test.com/" version="1.0">
<xs:element name="sayHello" type="tns:sayHello" />
<xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />
<xs:complexType name="sayHello">
<!-- 这里sequence里面是空的是因为没有参数,通常有参数的时候还有形如: -->
<!-- <xs:element minOccurs="0"> name="return" type="xs:string"/> -->
<!-- 这样的子元素。其中minOccurs表示最少出现0次,没有写明最多出现多少次,默认最多就是出现一次 -->
<xs:sequence />
</xs:complexType>
<xs:complexType name="sayHelloResponse">
<xs:sequence />
</xs:complexType>
</xs:schema>
</wsdl:types>
<!-- webservice 接口中的每一个方法对应两个message -->
<wsdl:message name="sayHello">
<wsdl:part element="tns:sayHello" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="sayHelloResponse">
<wsdl:part element="tns:sayHelloResponse" name="parameters"></wsdl:part>
</wsdl:message>
<!-- portType下面包含N个operation,每一个operation对应一个操作s -->
<wsdl:portType name="HelloWorld">
<wsdl:operation name="sayHello">
<!-- 传入消息为sayHello -->
<wsdl:input message="tns:sayHello" name="sayHello"></wsdl:input>
<!-- 传出消息为 -->
<wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldWSSoapBinding" type="tns:HelloWorld">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="sayHello">
<soap:operation soapAction="" style="document" />
<wsdl:input name="sayHello">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldWS">
<wsdl:port binding="tns:HelloWorldWSSoapBinding" name="HelloWorldImplPort">
<soap:address location="http://localhost:1234/ws" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

CXF学习(3) wsdl文件的更多相关文章

  1. (转)wsdl文件用SoapUI快速创建WebService,CXF生成客户端代码

    原文地址:http://blog.csdn.net/fjekin/article/details/62234861 一.前言 最近项目接触到2C的很多接口,提供接口文档和WSDL文件,一开始测试接口都 ...

  2. webservice 服务端例子+客户端例子+CXF整合spring服务端测试+生成wsdl文件 +cxf客户端代码自动生成

    首先到CXF官网及spring官网下载相关jar架包,这个不多说.webservice是干嘛用的也不多说. 入门例子 模拟新增一个用户,并返回新增结果,成功还是失败. 大概的目录如上,很简单. Res ...

  3. 使用Apache CXF根据wsdl文件生成代码

    1.去官网下载,我用的是apache-cxf-2.5.10.zip 2.解压 3.通过命令行进入Apache CXF的bin目录,如我的目录是D:\BIS\axis2\apache-cxf-2.7.1 ...

  4. cxf使用wsdl文件生成代码

    1.先下载cxf包 http://cxf.apache.org/download.html,现在cxf包.(下载资源就有) 2.解压缩包,通过cmd命令进入到bin目录下(cd cxf\bin的路径) ...

  5. php学习之道:php中soap的使用实例以及生成WSDL文件,提供自己主动生成WSDL文件的类库——SoapDiscovery.class.php类

    1. web service普及: Webservice soap wsdl差别之个人见解 Web Service实现业务诉求:  Web Service是真正"办事"的那个,提供 ...

  6. webservice系统学习笔记3-分析wsdl文件的组成

    详细分析前面章节的服务的wsdl文件 1.http://localhost:8888/ws01?wsdl 2.http://localhost:8888/ws01?xsd=1 在接口服务中添加复杂类型 ...

  7. 学习 WebService 第二步:知识准备——WSDL文件解析

    原文地址:https://www.cnblogs.com/yzw23333/p/7245104.html Web service中一个 WSDL 对应一个 web service地址. 可以想象成一个 ...

  8. 根据wsdl文件生成WebService客户端代码

    有时候在项目中,一个项目可能有好几个公司在做.系统之间难免会出现互相调用接口的现象,这时候有一种办法就是使用webService.本篇文章将介绍如何将对接系统提供的WebService接口,根据对方提 ...

  9. WebService 之 WSDL文件 讲解

    原文地址:http://blog.csdn.net/tropica/archive/2008/11/02/3203892.aspx 恩,我想说的是,是不是经常有人在开发的时候,特别是和第三方有接口的时 ...

随机推荐

  1. yaourt: a pacman frontend(pacman前端,翻译)

    yaourt: 一个pacman前端 本文翻译自:https://archlinux.fr/yaourt-en 1 juin 2007 - admin 关于 简介 获取 示例 截图 链接 关于 Yao ...

  2. 浏览器js自动查表脚本

    javascript: void((function() {$.get("", {wen: "880350384879600241",action: " ...

  3. python list 的+、+=和extend操作

    据说后者在list很大的时候性能稍好. 于是测试了一把: import time def time_cost(func): def _time_cost(*args,**kw): t1=time.ti ...

  4. Service

      一.什么是Service Service在后台运行,不与用户进行交互.在默认情况下,Service运行在应用程序进程的主线程中,如果需要在Service中处理一些网络连接等耗时的操作,那么应该将这 ...

  5. jQuery操作checkbox实例

    示意图 <script type="text/javascript"> $(function () { $("#ddlNumber").change ...

  6. ubuntu update dns server

    edit:  /etc/resolvconf/resolv.conf.d/base nameserver 114.114.114.114 execute this: $ resolvconf -u f ...

  7. WPF 中更新界面信息

    1.Dispatcher.BeginInvoke int ii = 0; new Thread(new ParameterizedThreadStart((i) => { while (true ...

  8. MVC RadioButton

    本文介绍如何创建radiobutton. Step 1: 创建一个类用于获取所有的选项. public class Company { public string SelectedDepartment ...

  9. SharePoint更改密码

    stsadm –o updatefarmcredentials –userlogin DomainName\UserName -password NewPassword –local  1. 通过管理 ...

  10. 【leetcode】Populating Next Right Pointers in Each Node II

    Populating Next Right Pointers in Each Node II Follow up for problem "Populating Next Right Poi ...