function makeSoapRequest(form){
// create the payload of the SOAP request
var soapData = '<?xml version="1.0" encoding="utf-8"?>' +
'<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">'+
' <header xmlns=\"http://schemas.cordys.com/General/1.0/\">'+
'</header>'+
'<SOAP:Body>'+
'<authenticateAgainstOID xmlns=\"http://schemas.cordys.com/OIDAuthentication">'+
' <stringParam>HEMANTS_MUM013</stringParam>'+
'<stringParam1>TATA2012</stringParam1>'+
'</authenticateAgainstOID>'+
' </SOAP:Body>'+
'</SOAP:Envelope>';
alert(soapData);
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
}catch(e){
// alert("Permission UniversalBrowserRead denied.");
};
try{
if (window.XMLHttpRequest){
req = new XMLHttpRequest();
}else{
req = new ActiveXObject("authenticateAgainstOID");
}
}catch(e){
};
req.open("POST", "http://tmcrmappsqa.inservices.tatamotors.com/cordys/com.eibus.web.soap.Gateway.wcp?organization=o=B2C,cn=cordys,cn=cbop,o=tatamotors.com&SAMLart=MDFn+8e5dRDaRMRIwMY7nI84eEccbx+lIiUGdimp3m+PzJ5ZSdKFP54f", false);
req.setRequestHeader("Content-Length", soapData.length);
req.setRequestHeader("Content-Type", "text/xml");
req.setRequestHeader("Soapaction", "http://tmcrmappsqa.inservices.tatamotors.com/cordys/com.eibus.web.soap.Gateway.wcp?organization=o=B2C,cn=cordys,cn=cbop,o=tatamotors.com&SAMLart=MDFn+8e5dRDaRMRIwMY7nI84eEccbx+lIiUGdimp3m+PzJ5ZSdKFP54f");
req.send(soapData);
document.getElementById('response').innerHTML = req.responseText;
var xmlDocument1 = req.responseXML;
parseXmlDocument(xmlDocument1);
}
function parseXmlDocument(docName){
var xmlDoc = new ActiveXObject("authenticateAgainstOID");
xmlDoc.async = "false";
xmlDoc.load(docName);
var token = xmlDoc.getElementByTagName("authenticateAgainstOID").text;
for (var i=0; i < fullNodeList.length; i++)
{
var eachnode = new Option();
eachnode.text = fullNodeList[i].childNodes[0].nodeValue;
eachnode.value = fullNodeList[i].attributes[0].value;
}
alert(token);
};
can anyone suggest me the proper way to set the soap request to get the response.i have tried this way.
This post has been edited by macosxnerd101: 03 September 2012 - 05:11 AM
Reason for edit:: Please use code tags

New Topic/Question
Reply


MultiQuote




|