Web testing Difference of SOAP 1.1 and 1.2

Originally posted by NisHera on November 23, 2017

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?

Originally posted by AlexKaras on November 23, 2017

Hi,

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

Any real reason do do it that complex way instead of regular one: https://support.smartbear.com/testcomplete/docs/app-testing/web/services/creating.html ?

You should be able to specify SOAP 1.2 in the Web Service Editor.

Originally posted by HKosova on November 24, 2017

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> 

Originally posted by AlexKaras on November 24, 2017

Helen, awesome!

Thank you a lot for this.

Originally posted by NisHera on November 26, 2017

Hi,

Thanks HKosova for your detail explanation. Since web service testing is a small part of test suite I would keep that withing TC. For AlexKaras question it’s mainly curiosity and learning purpose. I like to get my hand dirty and if had time, to get to know what is under the bonnet.