Search code examples
web-servicessoapwsdl

How to find wsdl version


Can any one please suggest how can I find wsdl version my web service is exposing -
snippet from 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/">

I have gone through these web links - https://coderanch.com/t/502335/certification/determine-wsdl-version
according to above post it's 1.2

whereas looking at this - https://www.soapui.org/docs/soap-and-wsdl/working-with-wsdls/
SoapUI documentation says "SoapUI supports 1.1 version of the WSDL specification". Because my wsdl loads successfully in SoapUI - could it be version 1.1?

So, I am not sure which version of wsdl (1.1/1.2/2.0) my web service is exposing.

Any suggestions please.


Solution

  • There are two WSDL versions: 1.1 and 2.0. A history of how these versions got to be can be found on the Wikipedia page for WSDL.

    Also on that page it's a useful image of the differences between them and how to recognize the version you are dealing with:

    enter image description here

    The easiest way is to look at the root element in the XML:

    • if it's called <definitions> then it's a WSDL 1.1;
    • if it's called <description> then it's a WSDL 2.0;

    Most of the WSDLs you will find out there will be version 1.1, but if the technology is newer, it might also be possible to retrieve a WSDL 2.0. See for example the answer on this post for more details about some conventions of retrieving a SOAP web service's WSDL if it provides one.