Problem Login to WebSocket API

Using a Windows C# test program, we are getting reliable Authentication responses from api.ppe.refinitiv.com.

We are now trying to login to the WebSocket API at ws://api.ppe.refinitiv.com:15000/WebSocket.using the WebSocketSharp.WebSocket (1.0.3-rc11) which is connecting and appears to be sending:

GET /WebSocket HTTP/1.1

User-Agent: websocket-sharp/1.0

Host: api.ppe.refinitiv.com:15000

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Key: xxxxxxx

Sec-WebSocket-Protocol: tr_json2

Sec-WebSocket-Version: 13

Cookie: ApplicationId=256; AuthenticationToken=xxxxxxx

Note the AuthenticationToken is truncated.

After a few seconds of connect, the WebSocket is abruptly closed with the error code 1006 and reason '"An exception has occurred while connecting."'.

We have also set the Authentication Token, Position and Application Id cookies that are to be sent during the login process. But the documentation and example code we have is not consistent as to the naming convention of these cookies:

AuthToken or AuthenticationToken or AuthnToken

AuthPosition or Position

applicationId or ApplicationId

Furthermore, we are not getting any of the events: OnOpen, OnError.

Can you indicate where we may be going wrong?

Maybe there is a more recent document than “WebsocketAPI_ProtocolSpecification.pdf” v1.4 of Oct 2020?

Many thanks in advance







Best Answer

  • Gurpreet
    Answer ✓

    Hi @tony10,

    Can you please try this .NET example and see if it works for you? In your example, you are sending the authentication token along with the connection-upgrade request. Server is expecting a login request message on the websocket instead and maybe why it closes the connection.

    Either way, please use one of the samples to understand the workings. Thanks.

Answers