what is wrong this JS ? got this error: cannot use object of type stdclass as array

拜拜、爱过 提交于 2019-12-24 20:24:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!