- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 03:07 AM
Hi All,
When i am running the Rest API its getting below error, but its working fine in the Postman.
Please help me how to avoid this error
Error: -
org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 10000 ms when posting to http://199.16.197.107:808/service/features
Thanks
Ramesh R
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 03:13 AM
Hi Ramesh,
you can try increasing the timeout for Outbound REST.
- Property:
glide.http.outbound.max_timeout
- Description: Specifies the number of seconds that RESTMessageV2 and SOAPMessageV2 APIs wait for a response from a synchronous call. The maximum value is 30 seconds.
How to increase the timeout for a REST response? (ECCResponseTimeoutException)
https://hi.service-now.com/kb_view.do?sysparm_article=KB0694711
Another method is while you are consuming the Rest message using script you can use this method
setHttpTimeout(Number timeoutMs)
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 03:13 AM
Hi Ramesh,
you can try increasing the timeout for Outbound REST.
- Property:
glide.http.outbound.max_timeout
- Description: Specifies the number of seconds that RESTMessageV2 and SOAPMessageV2 APIs wait for a response from a synchronous call. The maximum value is 30 seconds.
How to increase the timeout for a REST response? (ECCResponseTimeoutException)
https://hi.service-now.com/kb_view.do?sysparm_article=KB0694711
Another method is while you are consuming the Rest message using script you can use this method
setHttpTimeout(Number timeoutMs)
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 04:26 AM
I have used MID server then i created this property
- Property:
glide.http.outbound.max_timeout
- Description: Specifies the number of seconds that RESTMessageV2 and SOAPMessageV2 APIs wait for a response from a synchronous call. The maximum value is 30 seconds.
Now its working as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2022 02:02 PM
So documentation says if its set to a higher value it will default to 30 secs, so in order to achieve this first step would be to set the property to false glide.http.outbound.max_timeout and add glide.rest.outbound.ecc_response.timeout to a higher value than 300 secs which is default
Also how to set sm.setHttpTimeout(6000) if REST API call is being made via flow action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 03:26 AM
Hello Ramesh,
Default quota rules:-
https://docs.servicenow.com/csh?topicname=c_DefaultQuotaRules.html&version=jakarta
- REST Import Set API request timeout: Prevents inbound REST Import Set API transactions from running for longer than 60 seconds.
- REST Table API request timeout: Prevents inbound REST Table API transactions from running for longer than 60 seconds.
- REST Aggregate API request timeout: Prevents inbound REST Aggregate API transactions from running for longer than 60 seconds.
- REST Attachment API request timeout: Prevents inbound REST Import Set API transactions from running for longer than 60 seconds.
Here you might be hitting REST Table API request timeout.
Long-running SOAP request support
I hope this will help you.
Mark ✅ Correct if this solves your issue and also mark ???? Helpful if you find my response useful to you and help others to find information faster.
Thanks,
Tejas