我正在使用SOAP和JS。 这是一个代码,我不知道什么是问题,但我收到错误:不能使用stdclass类型的对象作为数组 我认为问题是我传递的随机值。
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);