Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
7 years ago
Solved

Web testing Difference of SOAP 1.1 and 1.2

I'm writing tests for web services as documented here ..link.

 

when I use 

XmlHttpRequest = Sys.OleObject("MSXML2.XMLHTTP.3.0");

for SOAP 1.1, code is  working perfectly. But not for SOAP 1.2

 

after much of frustration and  investigation (and bit of trail and error ) found that 

XmlHttpRequest = Sys.OleObject("MSXML2.XMLHTTP.6.0");

works for SOAP 1.2 

But there was no any explanation over the web ...Microsoft site was too verbose to understand and no luck.

 

could anybody shed some light what is happening?

 

 

  • HKosova's avatar
    HKosova
    7 years ago

    I'd go a bit further and recommend using our web service testing tools SoapUI (free) or ReadyAPI. They are specifically tailored for SOAP and REST service testing, support all major SOAP standards (SOAP 1.1/1.2, MTOM, WS-Addressing, WS-Security, etc.), provide easy request parameterization (using project variables and data from previous requests), include lots of SOAP and XML assertions (XPath Match, Not SOAP Fault, Valid HTTP Status Codes, etc.). SoapUI/ReadyAPI tests can also be integrated into TestComplete projects.

     

     

    To answer your original question, you should use MSXML 6.0 - it's the most recent version and is included in all Windows versions since Windows XP SP3. MSXML 3.0 may be used as a fallback, but 6.0 should work in most (all?) scenarios.
    https://en.wikipedia.org/wiki/MSXML#Versions

    http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx

     

    Alternatively, you can use TestComplete's WebServices project item (as AlexKaras suggested), or the aqHttp object included in TestComplete 12.40+, which provides similar functionality to MSXML2.XMLHTTP.

     

     

    SOAP 1.1 and 1.2 use a slightly different request format, so make sure you use the correct request headers and body.

     

    For example, using this calculator service:
    http://www.dneonline.com/calculator.asmx

     

    SOAP 1.1 request:

    POST /calculator.asmx HTTP/1.1
    Host: www.dneonline.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: <length>
    SOAPAction: "http://tempuri.org/Add"
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <Add xmlns="http://tempuri.org/"> <intA>2</intA> <intB>3</intB> </Add> </soap:Body> </soap:Envelope>

     

    SOAP 1.2 request:

    POST /calculator.asmx HTTP/1.1
    Host: www.dneonline.com
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: <length>
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <Add xmlns="http://tempuri.org/"> <intA>2</intA> <intB>3</intB> </Add> </soap12:Body> </soap12:Envelope> 

4 Replies

    • HKosova's avatar
      HKosova
      SmartBear Alumni (Retired)

      I'd go a bit further and recommend using our web service testing tools SoapUI (free) or ReadyAPI. They are specifically tailored for SOAP and REST service testing, support all major SOAP standards (SOAP 1.1/1.2, MTOM, WS-Addressing, WS-Security, etc.), provide easy request parameterization (using project variables and data from previous requests), include lots of SOAP and XML assertions (XPath Match, Not SOAP Fault, Valid HTTP Status Codes, etc.). SoapUI/ReadyAPI tests can also be integrated into TestComplete projects.

       

       

      To answer your original question, you should use MSXML 6.0 - it's the most recent version and is included in all Windows versions since Windows XP SP3. MSXML 3.0 may be used as a fallback, but 6.0 should work in most (all?) scenarios.
      https://en.wikipedia.org/wiki/MSXML#Versions

      http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx

       

      Alternatively, you can use TestComplete's WebServices project item (as AlexKaras suggested), or the aqHttp object included in TestComplete 12.40+, which provides similar functionality to MSXML2.XMLHTTP.

       

       

      SOAP 1.1 and 1.2 use a slightly different request format, so make sure you use the correct request headers and body.

       

      For example, using this calculator service:
      http://www.dneonline.com/calculator.asmx

       

      SOAP 1.1 request:

      POST /calculator.asmx HTTP/1.1
      Host: www.dneonline.com
      Content-Type: text/xml; charset=utf-8
      Content-Length: <length>
      SOAPAction: "http://tempuri.org/Add"
      
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <Add xmlns="http://tempuri.org/"> <intA>2</intA> <intB>3</intB> </Add> </soap:Body> </soap:Envelope>

       

      SOAP 1.2 request:

      POST /calculator.asmx HTTP/1.1
      Host: www.dneonline.com
      Content-Type: application/soap+xml; charset=utf-8
      Content-Length: <length>
      
      <?xml version="1.0" encoding="utf-8"?>
      <soap12:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <Add xmlns="http://tempuri.org/"> <intA>2</intA> <intB>3</intB> </Add> </soap12:Body> </soap12:Envelope>