Mr.*_*T.K 5 soap node.js reactjs
我尝试了几种通过Reactjs进行Soap调用的方法。但是我总是在每种方法上都遇到一些错误。有人可以在这里帮助我,还是请给我提供一些小的工作示例,以便我参考?
我曾尝试使用npm soap和easysoap软件包,但无法成功。任何可行的例子都非常有用。我也尝试了以下方法,但是它也不起作用。
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', '{My soap endpoint}', true);
// build SOAP request
var sr =
'<soap:Envelope xmlns:soap="{My soap request}"'
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
alert('done. use firebug/console to see network response');
}
}
}
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send(sr);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9268 次 |
| 最近记录: |