WSDL分析

根据以上示例:http://javaliver.iteye.com/blog/780251

 

   访问地址:   http://localhost:8080/CxfDemo?wsdl

 

  <?xml version="1.0" encoding="UTF-8" ?> 
<!-- wsdl的定义  targetNamespace获取或设置架构目标命名空间的统一资源标识符 (包名定义)-->
- <wsdl:definitions name="CxfDemoImplService" targetNamespace="http://demo.apacheCxf.javacode/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://demo.apacheCxf.javacode/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xs:schema elementFormDefault="unqualified" targetNamespace="http://demo.apacheCxf.javacode/" version="1.0" xmlns:tns="http://demo.apacheCxf.javacode/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--  参数  ,类型的定义-->
  <xs:element name="sayHelloWord" type="tns:sayHelloWord" /> 
<!--    返回值-->
  <xs:element name="sayHelloWordResponse" type="tns:sayHelloWordResponse" /> 
- <xs:complexType name="sayHelloWord">
- <xs:sequence>
<!--	第一个参数类型String,例如arg0,arg1,arg2......-->
  <xs:element minOccurs="0" name="arg0" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="sayHelloWordResponse">
- <xs:sequence>
  <xs:element minOccurs="0" name="return" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:schema>
  </wsdl:types>
<!--  把信息请求包装成message 给服务器。服务器再次包装message发送给客户端-->
- <wsdl:message name="sayHelloWord">
  <wsdl:part element="tns:sayHelloWord" name="parameters" /> 
  </wsdl:message>
- <wsdl:message name="sayHelloWordResponse">
  <wsdl:part element="tns:sayHelloWordResponse" name="parameters" /> 
  </wsdl:message>
<!--  对应借口,每个方法对应一个operation-->
- <wsdl:portType name="CxfDemo">
- <wsdl:operation name="sayHelloWord">
  <wsdl:input message="tns:sayHelloWord" name="sayHelloWord" /> 
  <wsdl:output message="tns:sayHelloWordResponse" name="sayHelloWordResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
<!--  binding定义了一个web service的消息格式和服务协议细节-->
- <wsdl:binding name="CxfDemoImplServiceSoapBinding" type="tns:CxfDemo">
<!--style属性可以是”rpc”或者”document”。本例中使用了document。transport属性定义要用的soap协议。本例中使用HTTP。-->
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
<!--  对于每一个operation,它对应的SOAP动作都必须被定义。也必须制定input和output如何被编码。本例中使用“literal”-->
- <wsdl:operation name="sayHelloWord">
  <soap:operation soapAction="" style="document" /> 
- <wsdl:input name="sayHelloWord">
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="sayHelloWordResponse">
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="CxfDemoImplService">
<!--	port描述一个web service 提供的接口-->
- <wsdl:port binding="tns:CxfDemoImplServiceSoapBinding" name="CxfDemoImplPort">
  <soap:address location="http://localhost:8080/CxfDemo" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>
 

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值