How to use the strong-soap.soap.createClient function in strong-soap

To help you get started, we’ve selected a few strong-soap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github revskill10 / next-template / api / core / create-soap-client.js View on Github external
return new Promise(function (resolve, reject) {
    soap.createClient(url, options, function(err, client) {
      if (err) {
        return reject(err)
      } else {
        return resolve(client)
      }
    })
  })
}
github strongloop / loopback-connector-soap / lib / soap-connector.js View on Github external
SOAPConnector.prototype.connect = function (cb) {
  var self = this;
  if (self.client) {
    process.nextTick(function () {
      cb && cb(null, self.client);
    });
    return;
  }
  if (debug.enabled) {
    debug('Reading wsdl: %s', self.wsdl);
  }
  soap.createClient(self.wsdl, self.settings, function (err, client) {
    if (!err) {
      if (debug.enabled) {
        debug('wsdl loaded: %s', self.wsdl);
      }
      if (self.settings.security || self.settings.username) {
        var sec = null;
        var secConfig = self.settings.security || self.settings;
        if (debug.enabled) {
          debug('configuring security: %j', secConfig);
        }
        switch (secConfig.scheme) {
          case 'WS':
          case 'WSSecurity':
            sec = new soap.WSSecurity(secConfig.username, secConfig.password,
              secConfig.passwordType || secConfig.options);
            break;