如何查找wsdl版本

ini*_*iki 2 soap wsdl web-services

任何人都可以建议我如何找到我的网络服务公开的 wsdl 版本 -
来自 wsdl 的片段 -

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"    
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" 
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns="http://tempuri.org/" 
xmlns:wsa10="http://www.w3.org/2005/08/addressing" 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
name="XXXService" targetNamespace="http://tempuri.org/">
Run Code Online (Sandbox Code Playgroud)

我已经浏览了这些网络链接 - https://coderanch.com/t/502335/certification/define-wsdl-version
根据上面的帖子,它是 1.2

而查看此 - https://www.soapui.org/docs/soap-and-wsdl/working-with-wsdls/
SoapUI 文档显示“SoapUI 支持 1.1 版本的 WSDL 规范”。因为我的 wsdl 在 SoapUI 中加载成功 - 它可能是版本 1.1 吗?

因此,我不确定我的 Web 服务正在公开哪个版本的 wsdl (1.1/1.2/2.0)。

有什么建议请。

Bog*_*dan 5

有两个 WSDL 版本:1.1 和 2.0。有关这些版本如何形成的历史可以在WSDL 的 Wikipedia 页面上找到。

另外,在该页面上,还有一个有用的图像,显​​示了它们之间的差异以及如何识别您正在处理的版本:

在此输入图像描述

最简单的方法是查看 XML 中的根元素:

  • 如果它被调用,<definitions>那么它就是 WSDL 1.1;
  • 如果它被调用,<description>那么它就是 WSDL 2.0;

您会发现大多数 WSDL 都是 1.1 版,但如果技术较新,也可能检索 WSDL 2.0。例如,请参阅这篇文章中的答案,了解有关检索 SOAP Web 服务的 WSDL(如果提供)的一些约定的更多详细信息。