我需要将基于SOAP的API与我的节点应用程序集成在一起,我正在使用npm [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
$wc = New-Object -TypeName System.Net.WebClient;
$wc.Headers.Add('Authorization','token ------------my token------------');
$wc.DownloadFile('https://github.com/Private/Repository/blob/master/hellothere.bat', '%~dp0hello_there.bat');
软件包来提供帮助。有人可以提供一些指导吗?我正在努力在此阶段执行基本登录。
给出的PHP示例:
soap
到目前为止,我尝试使用// define WSDL location
$wsdl = "https://www.someurl.co.za/ws/clients/?wsdl";
$username = '';
$password = '';
$soap_args = array(
'exceptions' => true,
'cache_wsdl' => WSDL_CACHE_NONE,
'soap_version' => SOAP_1_1,
'trace' => 1
);
// create SOAP Client
$client = new SoapClient($wsdl, $soap_args);
// Authenticate with username and password
$session_id = $client->login($username, $password);
包在Node.js中编写等效内容
soap
我现在遇到的错误
const url = "https://someurl.co.za/ws/clients/?wsdl";
const args = {
username: "",
password: "",
};
soap.createClient(url, function (err, client) {
client.login(args, function (err, result) {
console.log("Err", err);
});
});