How to use the soap.WSSecurity 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 nkjm / bot-express / sample_service / rightnow.js View on Github external
'use strict';

require("dotenv").config();

const soap = require("soap");
const memory = require("memory-cache");
const request = require('request');
const debug = require("debug")("bot-express:service");
Promise = require("bluebird");

const RN_USER = process.env.RN_USER;
const RN_PASSWORD = process.env.RN_PASSWORD;
const RN_HOSTNAME = process.env.RN_HOSTNAME;
const RN_WSDL = process.env.RN_WSDL;
const SOAP_WSS_SECURITY = new soap.WSSecurity(RN_USER, RN_PASSWORD, {hasTimeStamp: false, hasTokenCreated: false});
const APP_API_ID = 'kobaton';
const APP_IP_ADDRESS = '10.0.0.0';

Promise.promisifyAll(soap);
Promise.promisifyAll(request);

module.exports = class RightNow {

    static bot_rate_answer(interaction_id, content_id, rate, scale){
        debug("bot_rate_answer() started.");

        return RightNow.get_client().then(
            // Rate the content.
            (client) => {
                return RightNow.rate_content(client, interaction_id, content_id, rate, scale);
            }