-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccountsServer.js
More file actions
37 lines (34 loc) · 1 KB
/
Copy pathaccountsServer.js
File metadata and controls
37 lines (34 loc) · 1 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
37
'use strict';
let join = require('path').join;
let fs = require('fs');
let createServerHelper = require('./helpers/createServer');
let createSoapServerHelper = require('./helpers/createSoapServer');
let SoapService = class {
constructor (service, wsdlFile, path) {
this.server = null;
// service description
this.service = require('./services/' + service);
// wsdl interface description (xml)
this.wsdl = fs.readFileSync(join(__dirname, wsdlFile), 'utf8');
this.path = path || '';
}
createServer (port) {
let self = this;
return createServerHelper.apply(self, arguments);
}
createSoapServer () {
let self = this;
return createSoapServerHelper.apply(self, arguments);
}
async startServer () {
let self = this;
await self.createServer(5089);
await self.createSoapServer();
}
};
new SoapService('accountsService', '/wsdl/accounts.wsdl', '/accountsList')
.startServer()
.catch(err => {
// handle errors at end of chain
console.log(22, err);
});