ServerXMLHttp - impossible to set timeouts

lbonivento
Member Posts: 4
Hello,
I try to change timeouts for ServerXMLHttp ('Microsoft XML, v3.0'.ServerXMLHTTP30) by using function settimeouts, but I always receive Timeout error when trying to send to webservice.
Changing timeouts with function "setTimeouts(LONG resolveTimeout, LONG connectTimeout, LONG sendTimeout, LONG receiveTimeout )" don't seems to work because I receive Timeout error each time between 10 and 30 seconds, during execution of function XMLhttp.send(lParams).
Does someone have any idea on what I'm doing wrong ? See my code below :
Thanks a lot for your help.
Regards,
LBonivento
I try to change timeouts for ServerXMLHttp ('Microsoft XML, v3.0'.ServerXMLHTTP30) by using function settimeouts, but I always receive Timeout error when trying to send to webservice.
Changing timeouts with function "setTimeouts(LONG resolveTimeout, LONG connectTimeout, LONG sendTimeout, LONG receiveTimeout )" don't seems to work because I receive Timeout error each time between 10 and 30 seconds, during execution of function XMLhttp.send(lParams).
Does someone have any idea on what I'm doing wrong ? See my code below :
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;
Thanks a lot for your help.
Regards,
LBonivento
0
Comments
-
0
-
Hello 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 :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(lWinHTTP) THEN CREATE(lWinHTTP); lWinHTTP.Open('POST', lUrl, FALSE); lWinHTTP.SetRequestHeader('Content-type', 'application/x-www-form-urlencoded'); lWinHTTP.SetRequestHeader('Content-length', FORMAT(STRLEN(lParams))); lWinHTTP.SetTimeouts(999999999,999999999,999999999,999999999); lWinHTTP.Send(lParams); lResult := FORMAT(lWinHTTP.Status) + ':' + lWinHTTP.StatusText;
I try changing SetTimeouts value but I received a timeout every time between 15 and 25 seconds.
Maybe I miss something ?
Thanks for your help0 -
An idea'
create a var dummy or use a integer
dummy := 99999999;
then do the lWinHTTP.SetTimeouts(dummy,dummy, etc.0 -
Hmmmm ... I try to create a VARIANT to put as parameter as mentioned. And an Integer too, but always same problem after 25 seconds --> timeout0
-
Hi there
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions