javascript - 如何使用 jquery SOAP 从 jquery 消费 SOAP XML?
问题描述
我正在尝试将我的应用程序连接到 SOAP Web 服务 XML,即 jquery SOAP ( https://github.com/doedje/jquery.soap )。连接有效,但我没有获取数据。
我附上了我的代码(网址、用户和密码是示例),请帮助我。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="app/js/jquery.min.js"></script>
<script src="app/js/jquery.soap.js"></script>
</head>
<body>
<pre><code id="salida">...</code></pre>
</body>
<script>
$.soap({
url: 'http://myservice.com/sisWSAFI/Service.asmx',
method: 'GetSession',
data: {
user: 'user',
password: 'pass'
},
success: function(soapResponse) {
var respuesta = soapResponse.toString();
console.log(respuesta.GetSession);
},
error: function(SOAPResponse) {
// show error
}
});
</script>
</html>
解决方案
推荐阅读
- javascript - 网页抓取交互式图表
- javascript - jQuery:从输入数组中获取所有值并将它们计算为变量
- swift - 使用覆盖将 SwipeCellKit 连接到自定义单元格 - Swift
- python - Python CV2 颜色检测混淆
- algorithm - UTXO选择策略
- reactjs - 使用从父组件中进行的异步 api 调用接收的道具更新反应子组件的状态
- php - 未排序的数组 - 从下一个更高的值获取索引 | 复杂度 O(n), PHP
- javascript - 如何只允许粘贴输入中的 URL?
- python - 如何在 python 中正确重塑 ConvLSTM 的数据?
- javascript - onDeviceChange() 仅在 macOS Chrome 中正常工作