Error in http_statuses[[as.character(status)]] : subscript out of bounds, when creating connectio...

...n using DatastreamDSWS2R
When I am running the following using RStudio, I get the following error message. Can anyone help to fix the issue?
library('DatastreamDSWS2R')
options(Datastream.Username = 'XXXXXXX')
options(Datastream.Password = 'XXXXXXXX')
mydsws <- dsws$new()
Error in http_statuses[[as.character(status)]] : subscript out of bounds
Best Answer
-
Thank you so much for the update.
It may relate to the status code 470. From this page, the status code 470 is still unassigned.
I think that this is why it shows the following error when processing the status code 470.
Error in http_statuses[[as.character(status)]] : subscript out of bounds
From the error message: "Action: Deny. No rule matched. Proceeding with default action", it could be settings in the firewall that block this connection. You may need to contact your local IT support team to verify the problem.
0
Answers
-
Hello @stephen.guo
I cannot replicate the issue with my R version 4.0.5, it can initialize a connection successfully.
Basically, the DatastreamDSWS2R is a wrapper API for the DataStream WebServices http://product.datastream.com API endpoint. Can you access the
http://product.datastream.com URL or http://product.datastream.com/DswsClient/v1/DSService.svc/rest/help from your network?
Additionally, the DatastreamDSWS2R is a 3rd Party library that not develop and maintain by Refinitiv, you may submit the issue in the GitHub issue page directly.
0 -
You can run the below code to verify the problem.
library(httr)
DatastreamUsername <- "Username"
DatastreamPassword <- "Password"
token_url <- paste("http://product.datastream.com/DSWSClient/V1/DSService.svc/rest/Token?username=",
DatastreamUsername,
"&password=",
DatastreamPassword,
sep="")
test <- httr::GET(token_url, httr::timeout(300))
print(test)
print(status_code(test))
print(headers(test))
print(content(test))After running, please remove your credential from the output and share it.
0 -
Many thanks for your help here! I have run your test code and getting the following results.
library('httr')
> DatastreamUsername <- "username"
> DatastreamPassword <- "password"
> token_url <- paste("http://product.datastream.com/DSWSClient/V1/DSService.svc/rest/Token?username=",
+ DatastreamUsername,
+ "&password=",
+ DatastreamPassword,
+ sep="")
> test <- httr::GET(token_url, httr::timeout(300))
> print(test)
Date: 2021-05-19 06:14
Status: 470
Content-Type: text/plain; charset=utf-8
Size: 199 B
> print(status_code(test))
[1] 470
> print(headers(test))
$date
[1] "Wed, 19 May 2021 06:14:14 GMT"
$`content-length`
[1] "199"
$`content-type`
[1] "text/plain; charset=utf-8"
attr(,"class")
[1] "insensitive" "list"
> print(content(test))
[1] "HTTP request from 10.190.168.182:56148 to product.datastream.com:80. Url: product.datastream.com/DSWSClient/V1/DSService.svc/rest/Token. Action: Deny. No rule matched. Proceeding with default action"
0 -
Hello @stephen.guo
The error message "Deny. No rule matched. Proceeding with default action " means your network blocks access to the DataStream API endpoint (product.datastream.com) .
I suggest you contact your IT Network team to help you.
0 -
Many thanks! I think it makes sense.
0 -
Many thanks! I think it makes sense.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 167 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 705 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 3K Elektron
- 1.5K EMA
- 259 ETA
- 569 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 4 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 284 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 24 RDMS
- 2.2K Refinitiv Data Platform
- 879 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 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
- 123 Open DACS
- 1.1K RFA
- 108 UPA
- 196 TREP Infrastructure
- 232 TRKD
- 919 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 103 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛