-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient-local.js
More file actions
36 lines (30 loc) · 1.08 KB
/
Copy pathclient-local.js
File metadata and controls
36 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const https = require('https');
const fs = require('fs');
const soap = require('soap');
// Include root CA
// var ca = fs.readFileSync('./CA_Sistem_Terdistribusi_2015.crt');
// https.globalAgent.options.ca = [ca];
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
soap.createClient('https://sisdis.local/wsdl', function (err, client) {
if (err) return console.log(err);
// register
// client.register({ user_id: '1206208315', nama: 'Widyanto Bagus Priambodo', ip_domisili: 'https://priambodo.sisdis.ui.ac.id' }, (err, response) => {
// if (err) return console.log(err);
// console.log(response);
// });
// transfer
client.transfer({ user_id: '1206208315', nilai: '1000' }, (err, response) => {
if (err) return console.log(err);
console.log(response);
// getSaldo
client.getSaldo({ user_id: '1206208315' }, function (err, response) {
if (err) return console.log(err);
console.log(response);
});
});
// ping
// client.ping(null, function (err, response) {
// if (err) return console.log(err);
// console.log(response);
// });
});