For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
21 2 2 3

I couldn't connect to DSS with DSS REST API

DSS Endpoint: https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken

DSS IP: 164.57.211.94


I could connect to DSS and get token with Postman via REST API .

But I couldn't get token via the DSS2Token example offered by Refinitiv. Under JDK 1.7 and JDK 1.8, it outputted error messenger:

main, handling exception: java.net.SocketException: Connection reset

%% Invalidated: [Session-4, SSL_NULL_WITH_NULL_NULL]

main, SEND TLSv1.2 ALERT: fatal, description = unexpected_message

main, WRITE: TLSv1.2 Alert, length = 2

main, Exception sending alert: java.net.SocketException: Connection reset by peer: socket write error

main, called closeSocket()


At the same time, I couldn't got any response from DSS with curl:

curl -v -H 'Content-Type:application/json' -XPOST https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken

it outputted:

* About to connect() to hosted.datascopeapi.reuters.com port 443 (#0)

* Trying 164.57.211.94...

* Connected to hosted.datascopeapi.reuters.com (164.57.211.94) port 443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* CAfile: /etc/pki/tls/certs/ca-bundle.crt

CApath: none

* NSS error -5961 (PR_CONNECT_RESET_ERROR)

* TCP connection reset by peer

* Closing connection 0

curl: (35) TCP connection reset by peer


Howover, I could access the rebranded DSS with curl, as following:

curl -v -H 'Content-Type:application/json' -XPOST https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken


I tried many ways to connect to DSS, but it still didn't work.

Please tell me how to connect to DSS(hosted.datascopeapi.reuters.com) via REST API by Java


DSS2Token.zip

dss-rest-apidatascope-selectdss
dss2token.zip (1.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you for your participation in the forum.
Is the reply below satisfactory in answering your question?
If yes please click the 'Accept' text next to the reply.
This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
AHS

@yujin.xu11

Hi,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

@yujin.xu11

I can run it properly with the CURL command and DSS2Token Java example.

curl -H "Content-Type: application/json" -H "Prefer: respond-async" -X POST -v -d "{\"Credentials\": {\"Username\": \"username\",\"Password\": \"password\"}}" https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken

The output is output.txt. I am using curl 7.53.1.

For Java, I use the following commands to build and run the example.

C:\Java\DSS2_Java_Examples\src\com\refinitiv\dss\api\example>"c:\Program Files\Java\jdk1.8.0_261\bin\javac.exe" DSS2Token.java -classpath "C:\Java\DSS2_Java_Examples\src;C:\Java\DSS2_Java_Examples\lib\commons-codec-1.9.jar;C:\Java\DSS2_Java_Examples\lib\commons-logging-1.2.jar;C:\Java\DSS2_Java_Examples\lib\httpclient-4.5.3.jar;C:\Java\DSS2_Java_Examples\lib\httpcore-4.4.6.jar"

C:\Java\DSS2_Java_Examples\src\com\refinitiv\dss\api\example>"c:\Program Files\Java\jdk1.8.0_261\bin\java.exe" -classpath "C:\Java\DSS2_Java_Examples\src;C:\Java\DSS2_Java_Examples\lib\commons-codec-1.9.jar;C:\Java\DSS2_Java_Examples\lib\commons-logging-1.2.jar;C:\Java\DSS2_Java_Examples\lib\httpclient-4.5.3.jar;C:\Java\DSS2_Java_Examples\lib\httpcore-4.4.6.jar" com.refinitiv.dss.api.example.DSS2Token <username> <password>
Session Token (expires in 24 hours):
<token>

output.txt (2.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.