JavaScrip中的SOAP调用

2024-05-19 11:30:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我不熟悉JavaScript。我已经为SOAP请求编写了Python代码,如何在JavaScript中实现这一点?你知道吗

下面是我的Python代码。你知道吗

client = Client(url='url1', location='url')
security = Security()
token = UsernameToken('api_username', 'api_password')
security.tokens.append(token)
client.set_options(wsse=security)

Tags: 代码clienttokenapiurlusernamelocationpassword
1条回答
网友
1楼 · 发布于 2024-05-19 11:30:33

你试过thisjs包吗?你知道吗

作为doc中的一个简单示例:

let soap = require('soap');
let url = 'http://example.com/wsdl?wsdl';
let args = {
    name: 'value'
};

soap.createClientAsync(url)
    .then((client) => {
        return client.MyFunctionAsync(args);
    })
    .then((result) => {
        console.log(result);
    });    

相关问题 更多 >

    热门问题