How to use the soap.createClient function in soap

To help you get started, weā€™ve selected a few 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 CommonBike / commonbike-site / zandbak / 20170410skopei_test / test_soap.js View on Github external
function testsoap() {
		var soap = require('soap');
		soap.createClient(gSkopeiURL, function(err, client) {
				// var info = client.describe();

				// var args = {Text: 'hahahoho'};
				// add_authentication(args);

		  //   client.TestWebservice(args, function(err, result) {
		  //   		if(err) {
			 //        log_line('TestWebservice - error ' + err);
		  //   		} else {
			 //        log_line(result);
		  //   		}
		  //   });

				var args = { ElockID: "170178"}; // , PeriodTill: '2017-04-30T23:59:59Z'}
				add_authentication(args);
github nrkno / tv-automation-server-core / meteor / server / api / integration / soap.ts View on Github external
let soapClient: soap.Client = await new Promise((resolve: (soapClient: soap.Client,) => any, reject) => {
		soap.createClient(url, (err, client: soap.Client) => {
			// console.log('callback', err)
			// console.log('keys', _.keys(client))
			if (err) reject(err)
			else resolve(client)
		})
	})
github itsKaynine / thailand-post / lib / TrackService.js View on Github external
TrackService.prototype.init = function init(callback) {
	var self = this;

	// Ignore self signed certificate error
	process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"

	soap.createClient(WSDL_PATH, {endpoint: ENDPOINT}, function(err, client) {
		if (err) {
			return callback(err);
		}

		updateSecurity(client);
		updateToken(client);

		var args = {
			user: self.defaultArgs.user,
			password: self.defaultArgs.password,
			deviceType: self.defaultArgs.deviceType,
			lastmessage: "",
			lang: self.defaultArgs.lang
		};

		client.MessageBoardJson(args, function(err, res) {
github kevinohara80 / dmc / lib / soap-client.js View on Github external
sfClient.getIdentity({ oauth: oauth }, function(err, res) {
    if(err) return cb(err);
    soap.createClient(mdWsdl, function(err, client) {
      if(err) return cb(err);
      //client.setSecurity(new soap.BearerSecurity(oauth.access_token));

      var header = {
        'SessionHeader': {
          'sessionId': oauth.access_token
        }
      };
      var name = '';
      var xmlns = 'http://soap.sforce.com/2006/04/metadata';
      var ns = 'urn';
      //
      client.addSoapHeader(header, name, ns, xmlns);

      // var header = [
      //   '',
github ringcentral / ringcentral-js / test / lib / AccountGenerator.js View on Github external
this.connectionPromise = new Promise(function(resolve, reject) {

            var url = self.server + '/ags/ws?wsdl';

            console.log('Connecting to', url);

            soap.createClient(url, function(e, cl) {
                console.info('AccountGenerator: SOAP has been connected', e && e.message || '');
                if (e) throw e;
                self.client = cl;
                resolve(self.client);
            });

        });
github tellform / tellform / scripts / oscarhost / test_oscarhost.js View on Github external
function (callback) {	
		//Authenticate with API
		soap.createClient(url_login, options, function(err, client) {
			client.login(args_login, function (err, result) {
				if(err) callback(err);
				callback(null, result.return);
			});
		});
	},
	function (security_obj, callback){
github RappidDevelopment / quickbooks-js / test / client / client.js View on Github external
Client.prototype.createClient = function(callback) {
    var that = this;
    soap.createClient(url, function(err, client) {
        if (err) return callback(err);
        that.client = client;
        return callback(null);
    });
};
github DivanteLtd / storefront-api / src / api / extensions / gls-parcelshop-dk / cli.js View on Github external
}, (err, resp, status) => {
        if (err) {
          console.log(err);
        } else {
          console.log('create', resp);
        }
      });
    } else {
      console.log('Index gls_parcelshop_dk, already exists')
    }
  })

  let url = 'http://www.gls.dk/webservices_v2/wsPakkeshop.asmx?wsdl'
  let bulk = []

  soap.createClient(url, (err, client) => {
    client.GetAllParcelShops({}, (err, result) => {
      if (result.GetAllParcelShopsResult) {
        for (let i = 0; i < result.GetAllParcelShopsResult.PakkeshopData.length; i++) {
          let droppoint = result.GetAllParcelShopsResult.PakkeshopData[i]

          bulk.push(
            {
              index: {
                _index: 'gls_parcelshop_dk',
                _type: 'droppoint',
                _id: droppoint.Number
              }
            }
          )
          bulk.push(droppoint)
        }
github FredHutch / Oncoscape / server / auth-module.js View on Github external
var authSoap = function(username, password, domain, url, cb) {
    var args = {
        username: username,
        password: password,
        domain: domain
    };
    soap.createClient(url, function(err, client) {
        client.Logon(args, function(err, result) {
            cb(result.LogonResult === '');
        });
    });
};
github sinabakh / mellat-checkout / src / mellat.js View on Github external
initialize(callback) {
    if (!callback) {
      return new Promise((resolve, reject) => {
        this.initialize((error, res) => {
          if (error) {
            return reject(error);
          }
          return resolve(res);
        });
      });
    }
    return Soap.createClient(this.config.apiUrl, {
      envelopeKey: 'x',
      overrideRootElement: {
        namespace: 'ns1',
      },
      wsdl_options: {
        timeout: this.config.timeout,
      },
    }, (error, client) => {
      if (error) {
        return callback(error);
      }
      this.client = client;
      return callback(null);
    });
  }