MARX#81919 Veel timeouts op facturen richting Tobias 365 - NQ lijst: proxy instelling toegevoegd

svn path=/Mareon/trunk/; revision=63264
This commit is contained in:
Marcel Bourseau
2024-01-19 13:59:37 +00:00
parent 5c02c7ce09
commit 346f366e8a
3 changed files with 56 additions and 32 deletions

View File

@@ -8,7 +8,7 @@
// Scheduled Connector/Adapter voor alle communcatie van Ax -> Facilitor
// Staat elke nn minuten gescheduled
//var proxy = "127.0.0.1:8888"; // Voor debugging met Fiddler
//var G_proxy = "127.0.0.1:8888"; // Voor debugging met Fiddler
function FCLT_Sync_START(){
F_PutSync(0);
@@ -740,12 +740,22 @@ function FACILITOR_2_Xtractor()
// 1.75 -- MARX#74747: Voor T365 de Facturen via de Saxton/JSON koppeling
// 1.76 -- MARX#80511: Weg met de Secrets en Tokens in de Mareon logging
// 1.77 -- MARX#81188: Toevoegen van nieuwe factuurvelden in de JSON structuur voor T365 - Failure, InvoiceSource, PaymentID, OrderArtikelOmschr
// 1.78 -- MARX#81877: Bij een fout in factuurkoppeling naar Viewpoint wordt de factuur toch verwerkt
// 1.78 -- MARX#81877: Bij een fout in factuurkoppeling naar Viewpoint wordt de factuur toch verwerkt + MARX#81919 Veel timeouts op facturen richting Tobias 365 - NQ lijst
var G_Mareon_Adapter = "1.78";
//MARX#56643: Test Haagwonen inkoopordernummer ontbreekt in Mareon ION001753
var G_new_date = new Date();
//Proxy-settings: MARX#81919 Veel timeouts op facturen richting Tobias 365 - NQ lijst
var SXH_PROXY_SET_PROXY = 2;
var SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS = 2
var SXH_SERVER_CERT_IGNORE_UNKNOWN_CA = 256
var SXH_SERVER_CERT_IGNORE_WRONG_USAGE = 512
var SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID = 4096
var SXH_SERVER_CERT_IGNORE_CERT_DATE_INVALID = 8192
var SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Filepointer voor Logfile
var fso = new ActiveXObject("Scripting.FileSystemObject");
@@ -756,6 +766,7 @@ var G_settings_xml_file = WScript.Arguments(0);
var G_log_level = Read_Ini_Setting("common","logging");
__Log("************************************************** START Mareon Adapter ***********************************************", 0);
var G_proxy = Read_Ini_Setting("common","proxy");
var G_log_clean_days = Read_Ini_Setting("common","clean_log_days");
//MARX#76390 Kan oude logging van de SYNC adapter automatisch opgeruimd worden
//Defaultwaarde is 90 dagen, oftewel logbestanden worden zonder instelling van meer dan 3 maanden geleden opgeruimd.
@@ -837,6 +848,7 @@ var G_mar_timeout = 0; //initieel 1e keer.
__Log("***XML- ax/url(ServiceAX): " + G_ax_url_serviceax, 1);
__Log("***XML- ax2012/url(SupplierService): " + G_ax2012_url, 1);
__Log("***XML- ax2012/url(ServiceAX): " + G_ax2012_url_serviceax, 1);
if (G_proxy) __Log("***XML- AX365/proxy: " + G_proxy, 1);
__Log("***XML- ax365/url(SupplierService): " + G_ax365_url_supplierservice, 1);
__Log("***XML- ax365/url(ServiceAX): " + G_ax365_url_serviceax, 1);
__Log("***XML- tobias/url: " + G_tobias_url, 1);

View File

@@ -3,6 +3,8 @@
<common>
<!-- Logging/Loglevel: 0 (geen logging), 1 of 2 (uitgebreide logging). -->
<logging>0</logging>
<!-- IP van proxy-server indien van toepassing -->
<proxy></proxy>
</common>
<tobias>
<!-- URL van de Tobias webservice 'TobiasConnect' -->

View File

@@ -6,7 +6,7 @@
// MAREON Connector/Adapter Ax -> FACILITOR en Facilitor -> Ax
// --------------------------------------------------------------------------------------
//var proxy = "127.0.0.1:8888"; // Voor debugging met Fiddler
//var G_proxy = "127.0.0.1:8888"; // Voor debugging met Fiddler
// Helper functies
@@ -75,10 +75,11 @@ function apiFCLT_inner(v_URL, v_API, v_APIKEY, v_req, v_type, v_soap_envelope, v
// var xmlhttp = new ActiveXObject("WinHTTP.WinHTTPRequest.5.1");
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
var xmlUrl = v_URL + "?API=" + v_API + "&APIKEY=" + v_APIKEY + "&MareonAdapter=" + G_Mareon_Adapter;
__Log("apiFCLT - Open Command",4);
@@ -181,9 +182,10 @@ function FcltAPI2(v_apikey, v_method, v_url, v_req, v_discard_active_abort, v_su
try
{
var objXMLHTTP = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
var SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
objXMLHTTP.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ objXMLHTTP.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
objXMLHTTP.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
objXMLHTTP.open(v_method, v_url, false);
@@ -432,9 +434,10 @@ function api2AX_inner (v_Url, v_API, v_req, v_type, v_discard_active_abort, v_so
var lSend = 30 * 1000;
var xmlhttp = new ActiveXObject("WinHTTP.WinHTTPRequest.5.1");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
xmlhttp.setRequestHeader("Content-Type", "application/soap+xml; charset=utf-8");
@@ -530,9 +533,10 @@ function api2_AX2012_inner (v_Url, v_API, v_req, v_type, v_soapAction, v_discard
var lSend = 30 * 1000;
var xmlhttp = new ActiveXObject("WinHTTP.WinHTTPRequest.5.1");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
@@ -657,9 +661,10 @@ function api2_AX365_inner (v_Url, v_API, v_req, v_type, v_soapAction, v_discard_
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
@@ -799,9 +804,10 @@ function api2_TWINQ_inner (v_Url, v_API, v_req, v_type, v_soapAction, v_discard_
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
@@ -934,9 +940,10 @@ function api_3P_inner (v_Url, v_API, v_req, v_type, v_soapAction, v_discard_acti
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
xmlhttp.setRequestHeader("Content-Type", "text/xml");
@@ -1210,9 +1217,10 @@ function apiIDentity (v_url, v_req, v_type, v_contenttype, v_discard_active_abor
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_url, false);
xmlhttp.setRequestHeader("Content-Type", v_contenttype);
@@ -1297,9 +1305,10 @@ function api2Tobias_inner (v_Url, v_API, v_req, v_type, v_runmethod, v_discard_a
var lSend = 30 * 1000;
var xmlhttp = new ActiveXObject("WinHTTP.WinHTTPRequest.5.1");
SXH_PROXY_SET_PROXY = 2;
if (typeof proxy != "undefined" && proxy)
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, proxy);
if (typeof G_proxy != "undefined" && G_proxy)
{ xmlhttp.option(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);
xmlhttp.setProxy(SXH_PROXY_SET_PROXY, G_proxy);
}
xmlhttp.open("POST", v_Url, false);
@@ -1851,7 +1860,8 @@ function Read_XML_File_Node(v_xml_file, v_node_name){
function Read_XML_Node(v_xml, v_node_name){
var v_result = "";
try{
var v_result = v_xml.selectSingleNode(v_node_name).text;
var v_node = v_xml.selectSingleNode(v_node_name);
if (v_node) v_result = v_node.text;
return v_result;
}
catch (e)