首页 > 解决方案 > 如何使用 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>

标签: javascriptphpjqueryxmlsoap

解决方案


推荐阅读