问题
i am using SOAP with JS. Here is a code, i dont know what is problem but i am getting error: cannot use object of type stdclass as array I think problem is the random value i am passing.
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "http://service.project-development-site.de/soap.php",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4) {
alert(xmlhttp.responseText);
}
}
var Username = "ALL";
xmlhttp.setRequestHeader("SOAPAction", "http://service.project-development-site.de/soap.php");
xmlhttp.setRequestHeader("Content-Type", "text/xml");
var myCars=new Array(); // regular array (add an optional integer
var xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>' +
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' +
'<soapenv:Header/>' +
'<soapenv:Body>' +
'<tem:getAccessTokenSoapInPart>' +
'<tem:soapIn>' +
'<tem:random>sss</tem:random>' +
'</tem:soapIn>' +
'</tem:getAccessTokenSoapInPart>' +
'</soapenv:Body>' +
'</soapenv:Envelope>';
xmlhttp.send(xml);
来源:https://stackoverflow.com/questions/6922058/what-is-wrong-this-js-got-this-error-cannot-use-object-of-type-stdclass-as-ar