DSSetup.GET(); CASE ExportType OF ExportType::Shop: lUrl := DSSetup."Ondango Shop API url"; ExportType::Product: lUrl := DSSetup."Ondango Product API url"; ExportType::Stock:lUrl := DSSetup."Ondango Stock API url"; END; lParams := 'api_key=' + DSSetup."Ondango API Key"; lParams += '&csv_file=' + DSSetup."Ondango FTP Folder url" + 'export/' + FileName; IF ISCLEAR(lXMLHTTP) THEN CREATE(lXMLHTTP); lXMLHTTP.open('POST', lUrl, FALSE); //Send the proper header information along with the request lXMLHTTP.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); lXMLHTTP.setRequestHeader('Content-length', FORMAT(STRLEN(lParams))); lXMLHTTP.setTimeouts(99999,99999,99999,99999); lXMLHTTP.send(lParams); lResult := FORMAT(lXMLHTTP.status) + ':' + lXMLHTTP.statusText;
Comments
http://mibuso.com/blogs/ara3n/2008/05/1 ... bservices/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for your reply.
I try to change automation and use WinHTTP as you preconize. But I've always the same problem. I use 'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest, and set code like below :
I try changing SetTimeouts value but I received a timeout every time between 15 and 25 seconds.
Maybe I miss something ?
Thanks for your help
create a var dummy or use a integer
dummy := 99999999;
then do the lWinHTTP.SetTimeouts(dummy,dummy, etc.
You have to set the timeot before making the OPEN:
// Instantiate a WinHttpRequest object.
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
// Set time-outs. If time-outs are set, they must
// be set before open.
WinHttpReq.SetTimeouts(30000, 30000, 30000, 30000);
// Initialize an HTTP request.
WinHttpReq.Open("GET", "http://www.microsoft.com", false);
// Send the HTTP request.
WinHttpReq.Send();
I have not tried it myself (yet) but is assume that it could bee your problem.
Best regards
Anders H.