IREP_SOA Integration WSDL概述(概念)
20150827 Created By BaoXinjian
一、摘要
1. 什么是 WSDL
WSDL 指网络服务描述语言
WSDL 使用 XML 编写
WSDL 是一种 XML 文档
WSDL 用于描述网络服务
WSDL 也可用于定位网络服务
WSDL 还不是 W3C 标准
2. WSDL 可描述网络服务(Web Services)
WSDL 指网络服务描述语言 (Web Services Description Language)。
WSDL 是一种使用 XML 编写的文档。这种文档可描述某个 Web service。它可规定服务的位置,以及此服务提供的操作(或方法)。
二、WSDL结构
1. WSDL 文档是利用这些主要的元素来描述某个 web service 的
2. 一个 WSDL 文档的主要结构是类似这样的:
<definitions>
<types>
definition of types........
</types>
<message>
definition of a message....
</message>
<portType>
definition of a port.......
</portType>
<binding>
definition of a binding....
</binding>
</definitions>
WSDL 文档可包含其它的元素,比如 extension 元素,以及一个 service 元素,此元素可把若干个 web services 的定义组合在一个单一的 WSDL 文档中。
3. 结构组件(1). WSDL 端口
<portType> 元素是最重要的 WSDL 元素。
它可描述一个 web service、可被执行的操作,以及相关的消息。
可以把 <portType> 元素比作传统编程语言中的一个函数库(或一个模块、或一个类)。
(2). WSDL 消息
<message> 元素定义一个操作的数据元素。
每个消息均由一个或多个部件组成。可以把这些部件比作传统编程语言中一个函数调用的参数。
(3). WSDL types
<types> 元素定义 web service 使用的数据类型。
为了最大程度的平台中立性,WSDL 使用 XML Schema 语法来定义数据类型。
(4). WSDL Bindings
<binding> 元素为每个端口定义消息格式和协议细节。
4. WSDL services<services>指定服务的一些信息,主要是指定服务的访问路径。
三、WSDL案例
Oracle Erp PLSQL发布为WSDL案例
<?xml version="1.0" encoding="UTF-8"?> <definitions name="ORACLEBXJ_EMP_PKG" targetNamespace="http://xmlns.oracle.com/apps/bxj/soaprovider/plsql/oraclebxj_emp_pkg/" xmlns:tns="http://xmlns.oracle.com/apps/bxj/soaprovider/plsql/oraclebxj_emp_pkg/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns1="http://xmlns.oracle.com/apps/bxj/soaprovider/plsql/oraclebxj_emp_pkg/create_employee/"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/apps/bxj/soaprovider/plsql/oraclebxj_emp_pkg/create_employee/"> <include schemaLocation="http://paleonode1.sh.paleotek.com:8002/webservices/SOAProvider/plsql/oraclebxj_emp_pkg/APPS_ORACLEBXJ_EMP_PKG_CREATE_EMPLOYEE.xsd"/> </schema> <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/apps/bxj/soaprovider/plsql/oraclebxj_emp_pkg/"> <element name="SOAHeader"> <complexType> <sequence> <element name="Responsibility" minOccurs="0" type="string"/> <element name="RespApplication" minOccurs="0" type="string"/> <element name="SecurityGroup" minOccurs="0" type="string"/> <element name="NLSLanguage" minOccurs="0" type="string"/> <element name="Org_Id" minOccurs="0" type="string"/> </sequence> </complexType> </element> </schema> </types> <message name="CREATE_EMPLOYEE_Input_Msg"> <part name="header" element="tns:SOAHeader"/> <part name="body" element="tns1:InputParameters"/> </message> <portType name="ORACLEBXJ_EMP_PKG_PortType"> <operation name="CREATE_EMPLOYEE"> <input message="tns:CREATE_EMPLOYEE_Input_Msg"/> </operation> </portType> <binding name="ORACLEBXJ_EMP_PKG_Binding" type="tns:ORACLEBXJ_EMP_PKG_PortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="CREATE_EMPLOYEE"> <soap:operation soapAction="http://paleonode1.sh.paleotek.com:8002/webservices/SOAProvider/plsql/oraclebxj_emp_pkg/"/> <input> <soap:header message="tns:CREATE_EMPLOYEE_Input_Msg" part="header" use="literal"/> <soap:body parts="body" use="literal"/> </input> </operation> </binding> <service name="ORACLEBXJ_EMP_PKG_Service"> <port name="ORACLEBXJ_EMP_PKG_Port" binding="tns:ORACLEBXJ_EMP_PKG_Binding"> <soap:address location="http://paleonode1.sh.paleotek.com:8002/webservices/SOAProvider/plsql/oraclebxj_emp_pkg/"/> </port> </service> </definitions>
Thanks and Regards
参考:W3School - http://www.w3school.com.cn/wsdl/
技术交流,技术讨论,欢迎加入
Technology Blog Created By Oracle ERP - 鲍新建
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?