Commit 3caadb3e authored by Marius Wybrands's avatar Marius Wybrands

stable version with some logging

parent 4ebe40cd
......@@ -57,11 +57,12 @@ exportService.TabellenExport = function(requestParameter){
return new Promise(function (resolve, reject) {
sendRequest('ExportService_2010', params).then(result => {
console.log("Result:", result);
//console.log("Result:", result);
resolve(result['soapenv:Envelope']['soapenv:Body'][params.method + 'Response'][params.method + 'Return']['tabellen']['tabellen']['tabellenDaten']['_text']);
});
})
}
exportService.AuspraegungInformation = function(requestParameter){
// force params to be an obj
......@@ -79,7 +80,8 @@ exportService.AuspraegungInformation = function(requestParameter){
resolve(result['soapenv:Envelope']['soapenv:Body'][params.method + 'Response'][params.method + 'Return']);
});
})
}
};
exportService.MerkmalInformation = function(requestParameter){
// force params to be an obj
......@@ -98,7 +100,8 @@ exportService.MerkmalInformation = function(requestParameter){
resolve(result['soapenv:Envelope']['soapenv:Body'][params.method + 'Response'][params.method + 'Return']);
});
})
}
};
exportService.ErgebnisExport = function(requestParameter){
// force params to be an obj
......@@ -120,7 +123,7 @@ exportService.ErgebnisExport = function(requestParameter){
//resolve(result['soapenv:Envelope']['soapenv:Body'][params.method + 'Response'][params.method + 'Return']);
});
})
}
};
......@@ -167,7 +170,7 @@ rechercheService.MerkmalsKatalog = function(requestParameter){
});
})
}
};
rechercheService.MerkmalAuspraegungenKatalog = function(requestParameter){
// force params to be an obj
......@@ -190,7 +193,7 @@ rechercheService.MerkmalAuspraegungenKatalog = function(requestParameter){
});
})
}
};
rechercheService.AuftraegeKatalog = function(requestParameter){
// force params to be an obj
......@@ -214,16 +217,29 @@ rechercheService.AuftraegeKatalog = function(requestParameter){
});
})
}
};
async function sendRequest(service,requestParams){
var sendRequest = function(service,requestParams) {
const result = await baseService.get(service, {params: requestParams});
return result.data;
return new Promise(function (resolve, reject) {
baseService.get(service, {params: requestParams}).then(response => {
console.log("response");
}
var parsed = responseParser(response, requestParams.method);
resolve(parsed);
})
.catch(function (error) {
console.log("------------------ ERROR ------------------");
console.log(error);
reject(error);
})
.then(function () {
});
})
};
var responseParser = function(response, method) {
var response1 = convert.xml2json(response.data, {compact: true, spaces: 4});
......@@ -265,7 +281,7 @@ var addAuftrag = function (param) {
return param || "false";
}
var addStand = function (param) {
return param || "01.01.1900";
return param || "";
}
var addListenLaenge = function (param) {
return param || "500";
......@@ -277,7 +293,7 @@ var addKriterium = function (param) {
return param || "Code";
}
var addTyp = function (param) {
return param || "alle";
return param || "Alle";
}
var addAuswahl = function (param) {
return param || "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment