WebService(2)_WSDL文档
2016-09-17 20:11
357 查看
WSDL样例
WSDL文档结构
a. portType :
i. 它可描述一个 web service、可被执行的操作,以及相关的消息。
ii. 可以把 <portType> 元素比作传统编程语言中的一个函数库(或一个模块、或一个类)。
iii. 实际就是 WebService 服务端(Server) 的接口.(当然了,WSDL端口似乎更高大上一点..)
b. message : 这里我的理解是 , message 是 对外开放的方法.(那个..Response 我还不知道是干嘛用的..)
c. type : 定义了一些 Server 端发布接口的数据类型
d. 在上面的例子中,仔细看,可以发现,在<wsdl:type>中,有两组<xs:complexType>节点,他们之间就定义了,对外开放接口的入参类型.
e. binding : 定义了通信协议.
参考资料: http://www.runoob.com/wsdl/wsdl-tutorial.html
<span style="font-size:14px;">WSDL文档案例 <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://inter.server.cxf.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CXFServerDemoImplService" targetNamespace="http://inter.server.cxf.com/"> <wsdl:types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://inter.server.cxf.com/" elementFormDefault="unqualified" targetNamespace="http://inter.server.cxf.com/" version="1.0"> <xs:element name="sayHello" type="tns:sayHello"/> <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/> <xs:complexType name="sayHello"> <xs:sequence> <xs:element minOccurs="0" name="arg0" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="sayHelloResponse"> <xs:sequence> <xs:element minOccurs="0" name="return" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:schema> </wsdl:types> <wsdl:message name="sayHelloResponse"> <wsdl:part element="tns:sayHelloResponse" name="parameters"> </wsdl:part> </wsdl:message> <wsdl:message name="sayHello"> <wsdl:part element="tns:sayHello" name="parameters"> </wsdl:part> </wsdl:message> <wsdl:portType name="CXFServerDemo"> <wsdl:operation name="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="CXFServerDemoImplServiceSoapBinding" type="tns:CXFServerDemo"> <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="CXFServerDemoImplService"> <wsdl:port binding="tns:CXFServerDemoImplServiceSoapBinding" name="CXFServerDemoImplPort"> <soap:address location="http://localhost:8088/CXFNoSpring/CXFServer"/> </wsdl:port> </wsdl:service> </wsdl:definitions> 来自 <http://localhost:8088/CXFNoSpring/CXFServer?wsdl> </span><span style="font-size: 20pt;"> </span>
WSDL文档结构
a. portType :
i. 它可描述一个 web service、可被执行的操作,以及相关的消息。
ii. 可以把 <portType> 元素比作传统编程语言中的一个函数库(或一个模块、或一个类)。
iii. 实际就是 WebService 服务端(Server) 的接口.(当然了,WSDL端口似乎更高大上一点..)
b. message : 这里我的理解是 , message 是 对外开放的方法.(那个..Response 我还不知道是干嘛用的..)
c. type : 定义了一些 Server 端发布接口的数据类型
d. 在上面的例子中,仔细看,可以发现,在<wsdl:type>中,有两组<xs:complexType>节点,他们之间就定义了,对外开放接口的入参类型.
e. binding : 定义了通信协议.
参考资料: http://www.runoob.com/wsdl/wsdl-tutorial.html
相关文章推荐
- poj3686 The Windy's(拆点,费用流,好题)
- hdu5878 2016青岛网络赛-打表+二分
- JAVA常见的RuntimeException
- 在单链表上实现插入排序
- 作业总结
- HDU 5883 The Best Path (欧拉路或者欧拉回路)
- Leetcode :3. Longest Substring Without Repeating Characters
- 【原创】东方耀reactnative 视频22之-DrawerLayoutAndroid
- Linux/unix inode
- Arrow Dialog
- HDU5879(打表)
- 彩虹七色的RGB值
- phpstorm 2016.2 的最新破解方法(截止2016-8-1)
- 只是不想生活在最底层
- WebService(1)_WebService概述
- Java NIO使用及原理分析(二)
- Failed to load resource: the server responded with a status of 406 (Not Acceptable)
- I2S协议
- C/S模型 多线程服务器实现简单计算工作并回馈客户端
- ubuntu /etc/profile和/etc/environment的比较