What is the simplest SOAP example using Javascript?
To be as useful as possible, the answer should:
Easily consume SOAP Web services with JavaScript -> Listing B
function fncAddTwoIntegers(a, b)
{
varoXmlHttp = new XMLHttpRequest();
oXmlHttp.open("POST",
"http://localhost/Develop.NET/Home.Develop.WebServices/SimpleService.asmx'",
false);
oXmlHttp.setRequestHeader("Content-Type", "text/xml");
oXmlHttp.setRequestHeader("SOAPAction", "http://tempuri.org/AddTwoIntegers");
oXmlHttp.send(" \
\
\
\
" + a + " \
" + b + " \
\
\
\
");
return oXmlHttp.responseXML.selectSingleNode("//AddTwoIntegersResult").text;
}
This may not meet all your requirements but it is a start at actually answering your question. (I switched XMLHttpRequest() for ActiveXObject("MSXML2.XMLHTTP")).