NavHttpClient Request Failed

rocatis
Member Posts: 163
I get this error when executing a HTTP Client Request from BC Code: "Code: 0, Message: NavHttpClient Request Failed, Error: The operation was canceled.". The error is thrown after what looks like (more or less) precisely 2 minutes. If I limit my request in BC so that it takes less than 2 minutes, it completes without errors.
If I send the exact same (full) request from Postman, it succeeds after about 4 minutes.
I've tried changing all 2 minute timeout values found in the Business Central Administration to 1:02:00, but to no avail:
Per default, Postman does not impose a timeout (File/Settings/Request timeout in ms is 0). If I change that to e.g. 10 seconds, Postman throws an error as expected: "Error: Response timed out/ESOCKETTIMEDOUT".
In Postman, two keys are set in the header: "Connection = keep-alive" and "Accept = */*". I am sending those from BC as well.
I'm convinced the issue is somehow related to a 2 minute timeout somewhere - please help me find it!
If I send the exact same (full) request from Postman, it succeeds after about 4 minutes.
I've tried changing all 2 minute timeout values found in the Business Central Administration to 1:02:00, but to no avail:
- Client Services/Keep Alive Interval
- OData Services/DeltaServiceClientTimeout
- Asynchronous Processing/Page Background Task Default Timeout
Per default, Postman does not impose a timeout (File/Settings/Request timeout in ms is 0). If I change that to e.g. 10 seconds, Postman throws an error as expected: "Error: Response timed out/ESOCKETTIMEDOUT".
In Postman, two keys are set in the header: "Connection = keep-alive" and "Accept = */*". I am sending those from BC as well.
I'm convinced the issue is somehow related to a 2 minute timeout somewhere - please help me find it!
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
Senior NAV Developer
Elbek & Vejrup
0
Answers
-
did you find the issue? i am having the same problem0
-
Var
Client: HttpClient;
Client.Timeout := 5 * 60 * 1000; // 5 minutes timeout
What you should note is that the max. setting is determined by the NavHttpClientMaxTimeout setting on the servicetier. This is also 2 minutes by default. If you try to set the value in code to anything larger than the setting on the servicetier, you get a runtime error.
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0
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