CXF生成的WSDL详解_第1页
CXF生成的WSDL详解_第2页
CXF生成的WSDL详解_第3页
CXF生成的WSDL详解_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、CXF生成的WSDl详解<?xml version='1.0' encoding='UTF-8'?><!-这里的name是发布的service类名 + "Service", targetNamespace 是取决于发布类所在的包 -> <wsdl:definitions name="HelloWorldImplService" targetNamespace="http:/test/"> <!-types 的作用是定义输入输出参数都是什么样子的(类型) ->

2、; <wsdl:types > <xs:schema elementFormDefault="unqualified" targetNamespace="http:/test/" version="1.0"> <!-输入参数名字为sayHello,类型是复杂类型sayHello,在下面定义 -> <xs:element name="sayHello" type="tns:sayHello"/> <!-输出参数名字为sayHelloRespon

3、se,类型是复杂类型sayHelloResponse, 在下面定义-> <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/> <!-输入参数类型的具体定义:包含一个element,名字为arg0,类型为string-> <xs:complexType name="sayHello"> <!- 这里的name 是自动生成的。当然,也可以在代码中指定名字。 public WebResult(name="s

4、ayHelloResult") String sayHello(WebParam(name="name") String str) -> <xs:sequence> <xs:element minOccurs="0" name="arg0" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="sayHelloResponse">

5、; <xs:sequence> <xs:element minOccurs="0" name="return" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:schema> </wsdl:types> <!-这个message代表输入信息。这个输入信息的类型是sayHello,在<types>中定义过 -> <wsdl:message name="sayH

6、ello"> <wsdl:part element="tns:sayHello" name="parameters"></wsdl:part> </wsdl:message> <!-这个message代表输出信息。这个输出信息的类型是sayHelloResponse,在<types>中定义过 -> <wsdl:message name="sayHelloResponse"> <wsdl:part element="tns:sayHe

7、lloResponse" name="parameters"> </wsdl:part> </wsdl:message> <!-portType 就是我们定义的接口。一个接口对应一个port -> <wsdl:portType name="HelloWorld"> <!-这里的一个operation就是 接口中的一个方法 -> <wsdl:operation name="sayHello"> <wsdl:input message="

8、;tns:sayHello" name="sayHello"> </wsdl:input> <wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse"> </wsdl:output> </wsdl:operation> </wsdl:portType> <!-把接口进行 soap 绑定-> <wsdl:binding name="HelloWorldImpl

9、ServiceSoapBinding" type="tns:HelloWorld"> <!- 这里指明绑定的协议为 http,style为document-> <soap:binding style="document" transport="/soap/http"/> <!- 具体方法的绑定类型定义-> <wsdl:operation name="sayHello"> <soap:operati

10、on soapAction="" style="document"/> <wsdl:input name="sayHello"> <!-literal文本 -> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="sayHelloResponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <!-把n个接口放到一起,总称为一个service -> <wsdl:service name="HelloWorldImplService"> <!-这里一个port就是一个接口。对应的绑定刚刚定义过 -> <wsdl:port binding="tns:HelloWorldImplServiceSoapBinding" name="HelloWorldImplPort&

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论