Getting Connection Times Out in the subsequent rest api call for DSS
Hi @zoya
I am able to get the auth token successfully ,however when doing the next call getting the below error.
I am connecting using proxy .Please help.
Session Token (expires in 24 hours):
_wQUWnpA0Ep7Nol3I8BOUDbpESHAHfHhDydLqnS0CoOYx_4lWUrxUG8qX4wRjOPJri-ET30v8p1wf56BaaYCAsOJBaY353K0M7CMHFlbvdoJoES0O8PIxcwrfIf-SV8EAKAnXexa28DXbwc5L7qaWNpiJLWUgBKiJ44S3dYubg5ADITl0CHrz4TZrn7-Dfw4c9eSF1AFTxw_sEV0w-GNl_wU5q7OijCCepEBs-iczwG_Xr8pxP1zVtFd4qWJm1jIW3ngZVMWQCFar93d50UOXXgmnh58wf8apB9UUjOu3Isk
Instrument list creation JSON request content:
@{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.SubjectLists.InstrumentList","Name":"Demo_TermsAndCondition_Instrumentslist"}
org.apache.http.conn.HttpHostConnectException: Connect to hosted.datascopeapi.reuters.com:443 [hosted.datascopeapi.reuters.com/192.165.219.152] failed: Connection timed out: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
Press "ENTER" to continue...
Best Answer
-
Hello @rattan,
I'd like to confirm that:
Your token is less then 24 hours old and is valid
You are yusing proxy info for the second request same as for the token request, as in Java examples on this portal, i.e.:
// Set proxy information for HTTP Components
HttpHost proxy = new HttpHost(proxyHostName, proxyPortNumber);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
CloseableHttpClient httpclient = HttpClients.custom()
.setRoutePlanner(routePlanner)
.build();If that is the case;
I would try testing another request, maybe run one of our Java request examples so you don't have to write custom code for this test:
Or, are you familiar with CURL, can you test with curl passing your proxy parameter at the end:
--proxy your_proxy:your_port
0
Answers
-
Please try to set connection timeout in the code.
private int timeout=30;
private RequestConfig config = RequestConfig.custom()
.setConnectTimeout( timeout * 1000)
.setConnectionRequestTimeout(timeout * 1000)
.setSocketTimeout(timeout * 1000).build();
private CloseableHttpClient httpclient = HttpClientBuilder.create().setDefaultRequestConfig(config).disableContentCompression().build();I found this code at http://www.baeldung.com/httpclient-timeout.
0 -
Thank you for this code for setting up the timeout.i have set the timeout in my code ,however it's still giving me the same error.Is there any setting needs to be done other than this.
And also i am able to fetch the authToken successfully ,but next call is not able to make connection.Please suggest.
Session Token (expires in 24 hours):
_lsR9iGnIr1NHvGagAivokEhVlambBzqa_SlI4QfmNkxj7bmXn2gQuE3boqOo7rG_-C3A9ERoPFFP7SywX_LMIET1vLX-lBjjP3Nbi_RawJsabVkW51x0Avs745uSSAKnLyf90E-rFsTXheCYhc-QPqs2qwGMdK1M5e5PCtw9ZjjzykUXW1Q7eHBqAxyYXUpBqt93eniNyHWrRDNPIsnP4704qyFyJicF9tKbhW2Gi6tb6Qtup2YQGGwPVFareXBcYmCxzzV0V1HyystNZFHdy1EmE7FJZOocKUmp-FGUiRs
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/Schedules
_lsR9iGnIr1NHvGagAivokEhVlambBzqa_SlI4QfmNkxj7bmXn2gQuE3boqOo7rG_-C3A9ERoPFFP7SywX_LMIET1vLX-lBjjP3Nbi_RawJsabVkW51x0Avs745uSSAKnLyf90E-rFsTXheCYhc-QPqs2qwGMdK1M5e5PCtw9ZjjzykUXW1Q7eHBqAxyYXUpBqt93eniNyHWrRDNPIsnP4704qyFyJicF9tKbhW2Gi6tb6Qtup2YQGGwPVFareXBcYmCxzzV0V1HyystNZFHdy1EmE7FJZOocKUmp-FGUiRs
org.apache.http.conn.HttpHostConnectException: Connect to hosted.datascopeapi.reuters.com:443 [hosted.datascopeapi.reuters.com/192.165.219.152] failed: Connection timed out: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)0 -
Thank you Zoya.I am able to make successful rest calls.
Thanks
Ratan
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛