I am a newbie in Node.Js and working on Google DialogFlow for some prototype bots. I am calling a Workday SOAP Web Service to fetch the information . I was able to get the below code working in Node.Js locally on my machine . Can anyone please help to get the same working in DialogFlow using Inline Editor
Code :-
*"use strict";
var fs = require('fs'),
assert = require('assert'),
request = require('request'),
http = require('http'),
lastReqAddress;
var soap = require('strong-soap').soap;
var XMLHandler = soap.XMLHandler;
var util = require('util');
//wsdl of the Web Service this client is going to invoke. This can point to local wsdl as well.
var url = 'https://community.workday.com/sites/default/files/file-hosting/productionapi/Human_Resources/v34.1/Human_Resources.wsdl';
var requestArgs = {
ElementName: 'Oxygen'
};
var clientOptions = {};
var Get_Workers_Args = {
"Get_Workers_Request": {
"$attributes": {
"version": "v34.1"
},
"Request_References": {
"Worker_Reference": {
"ID": {
"$attributes": {
"type": "Employee_ID"
},
"$value": "**21001**"
}
}
},
"Response_Group": {
"Include_Reference": "1",
"Include_Personal_Information": "1",
"Include_Additional_Jobs": "1",
"Include_Employment_Information": "1",
"Include_Compensation": "1",
"Include_Organizations": "1"
}
}
};
soap.createClient(url, clientOptions, function(err, client) {
//custom request header
var customRequestHeader = {timeout: 5000};
var options = {};
var description = client.describe();
var elements= description.Human_ResourcesService.Human_Resources.Get_Workers.input.body;
client.setEndpoint("https://wd2-impl-services1.workday.com/ccx/service/**Tenant**/Human_Resources");
client.addSoapHeader(`<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-6525124955572DD3B815893110892343">
<wsse:Username>**Username**</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">**Password**</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>`);
var Get_Workers_Method = client['Human_ResourcesService']['Human_Resources']['Get_Workers'];
Get_Workers_Method(Get_Workers_Args, function WorkdayWebServices(err, result, envelope, soapHeader) {
console.log(' PUT INSIDE GET Result: \n' + JSON.stringify(result));
console.log(' PUT INSIDE Request : \n' + JSON.stringify(Get_Workers_Args));
console.log(' PUT INSIDE GET Error: \n' + JSON.stringify(err));
});
});*
Can anyone please help in writing the code to invoke in Google DialogFlow. The intention is to pass the employee ID as text parameter under Worker Reference.
Appreciate any help regarding this!