getSupply basic

This commit is contained in:
Javi Gallego 2017-04-10 11:52:16 +02:00
parent 7716921005
commit c56f437fed
2 changed files with 5 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules
config.js
config.json

View File

@ -2,12 +2,11 @@ var querystring = require("querystring");
var xml2js = require('xml2js');
var soap = require('soap');
var getXml = require('./getXml');
var credential = require('./credential');
var config = require('./config.json');
function soapClient(xmlFile){
var url = 'http://services2-acc.floraholland.com/CommercialCustomer/CommercialCustomer_1p5.svc?wsdl';
var auth = "Basic " + new Buffer(credential.user + ":" + credential.pass).toString("base64");
var auth = "Basic " + new Buffer(config.user + ":" + config.pass).toString("base64");
var options =
{
wsdl_headers:{
@ -17,13 +16,14 @@ function soapClient(xmlFile){
valueKey: '_'
};
soap.createClient(url,options, function(err, client) {
if (err) {
console.log(err);
return;
}
client.setSecurity(new soap.BasicAuthSecurity(credential.use,credential.pass));
client.setSecurity(new soap.BasicAuthSecurity(config.user,config.pass));
console.log('no entra');
getXml.getXml(xmlFile, function(err, data) {
if (err) {