-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwsiv_easysoap.js
61 lines (48 loc) · 1.32 KB
/
wsiv_easysoap.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var easySoap = require('easysoap');
//soap client params
var clientParams = {
//set soap connection data (mandatory values)
// //www.ratp.fr/wsiv/services/Wsiv
host : 'www.ratp.fr',
path : '/wsiv/services/Wsiv',
wsdl : '/wsiv/services/Wsiv?wsdl',
//set soap header (optional)
header : []
};
//soap client options
var clientOptions = {
secure : false //is https or http
};
//create new soap client
var SoapClient = new easySoap.Client(clientParams, clientOptions);
SoapClient.once('initialized', function() {
console.log('initialized');
console.log(SoapClient.getAllFunctions());
//successful initialized
SoapClient.once('getVersion', function(data, header) {
console.log('here');
console.log(header);
console.log(data);
//soap response
});
SoapClient.call({
'method' : 'getVersion',
'params' : {
}
});
});
//initialize soap client
SoapClient.init();
function onClientCreated(err, client){
console.log(client);
// client.GetLines([], onGetLines);
}
function onGetLines(err, result){
console.log(result);
}
//var soap = require('soap');
//var url = 'http://www.ratp.fr/wsiv/services/Wsiv?wsdl';
//var args = {};
//soap.createClient(url, onClientCreated);
//
//