0

Looking at below 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 these questions -

  • Because above definition includes both -
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" and xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

    Can I safely say that both SOAP 1.1 and 1.2 are supported? or
    do I need to look at service code or any other part of wsdl to confirm this?

  • Another question is, when we talk about WSDL version - is it always same as SOAP version?
    So WSDL version 1.1 will be the one used by SOAP 1.1?

Thanks a lot for your time.

inutan
  • 10,558
  • 27
  • 84
  • 126

1 Answers1

2

For the first question, you need to look inside the WSDL file and see where the soap12 namespace prefix is used. You should find something like <soap12:binding>, <soap12:operation>, <soap12:address>, etc.

Having a SOAP 1.2 namespace declared in the WSDL isn't enough, you need to have XML elements declared in that namespace for it to be useful at something. If you don't have a binding and an address for the soap12 namespace prefix, then your service probably doesn't support it.

For your second question, the WSDL version does not match the SOAP protocol version. You can have WSDL 1.1 with SOAP 1.1 and a binding extension for SOAP 1.2, and you can have WSDL 2.0 with SOAP 1.1 and SOAP 1.2.

You should feed your WSDL to SoapUI and see in how many ways it allows you to call the service (on SOAP 1.1 or on both SOAP 1.1 and SOAP 1.2).

Bogdan
  • 23,890
  • 3
  • 69
  • 61
  • thanks a lot for your reply. soap12 is used only in the so my first doubt is sorted. For the second one - I have SoapUI(5.5) installed, how do I call the service for a particular SOAP version - is there any setting somewhere? – inutan Feb 11 '21 at 11:59
  • If the soap12 prefix isn't used in a binding then it means you can only call the service using SOAP 1.1. When you create a project in SoapUI by using a WSDL, SoapUI creates operations for all of your bindings. If the service exposes only SOAP 1.1 then you have one set of operations. If it also exposes SOAP 1.2 then SoapUI creates two sets of operations. You don't need a setting as SoapUI creates them all. But if you only have a SOAP 1.1 binding then you only get that set. – Bogdan Feb 11 '21 at 13:14
  • Thanks again, but how can I clarify about WSDL version? – inutan Feb 11 '21 at 13:57
  • You have a WSDL 1.1 because the root element is ``. For a WSDL 2.0, the root element is called ``. See this image for differences: https://upload.wikimedia.org/wikipedia/commons/c/c2/WSDL_11vs20.png – Bogdan Feb 11 '21 at 14:18
  • could you please reply this another SO question with WSDL version image - will help someone else looking for similar answer - https://stackoverflow.com/questions/66155090/how-to-find-wsdl-version – inutan Feb 11 '21 at 14:58
  • @inutan: Sure thing! – Bogdan Feb 11 '21 at 16:13