Ask a Question

Web testing Difference of SOAP 1.1 and 1.2

SOLVED
NisHera
Valued Contributor

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
HKosova
Moderator

Re: Web testing Difference of SOAP 1.1 and 1.2

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-explor...

 

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> 

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

4 REPLIES 4
AlexKaras
Community Hero

Re: Web testing Difference of SOAP 1.1 and 1.2

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.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
HKosova
Moderator

Re: Web testing Difference of SOAP 1.1 and 1.2

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-explor...

 

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> 

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

AlexKaras
Community Hero

Re: Web testing Difference of SOAP 1.1 and 1.2

Helen, awesome!

Thank you a lot for this.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
NisHera
Valued Contributor

Re: Web testing Difference of SOAP 1.1 and 1.2

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.  

cancel
Showing results for 
Search instead for 
Did you mean: