WebSocket API - Need help on running "MarketPriceEdpGwServiceDiscoveryExample" with WebSocketShar...

...p dll (Open source)
Hi Team,
Need your assistance while running the "MarketPriceEdpGwServiceDiscoveryExample" with WebSocketSharp dll (Open source).
Using the WebSocketSharp dll (Open source), I am able to do the authentication (the first step) but not able to make a WebSocket connection and the Ping result is coming as false and not able to connect to the server.
As per my understanding that we should be able to use the WebSocketSharp dll (Open source) to connect to WebSocket server in "MarketPriceEdpGwServiceDiscoveryExample" example.
Note: I am able to connect to the WebSocket Server without any issues when I use the inbuild WebScoket functionality of .NET Framework as mentioned in the example.
Also, I have all the required details to connect to a WebScoket server.
Could you please let me know your thoughts.
Thanks
Pradeep B
Best Answer
-
Hi @pradeep.badoni,
These are the steps you need to take:
1. Connect into the server:
WebSocket = new WebSocket(_uri.ToString(), "tr_json2");
WebSocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;
...
WebSocket.connect();*Note* Don't set cookies.
2. Login to the server
{
"ID": 1,
"Domain": "Login",
"Key": {
"Name": <streaming ID>, eg: "john.doe"
"Elements": {
"ApplicationId": "256",
"AppKey": "256",
"Position": "192.168.0.35",
"AuthenticationToken": "hRkY1Tmg4LTM4...d6bMP_VpwPRw"
},
"NameType": "AuthnToken"
}
}"*Note* - as per OAuth requirements, you will need to re-authenticate with the server using a new authentication token
3. Send your messages
Open your subscription:
{
"Key": {
"Name": "EUR="
},
"ID": 2
}"Close your subscription:
{
"ID": 2,
"Type": "Close"
}"0
Answers
-
Hi @pradeep.badoni,
You will need to enable SSL protocols, for example:
WebSocket = new WebSocket(_uri.ToString(), "tr_json2");
WebSocket.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;If you are developing in .Net, you also have the option of using the RDP Libraries. There is a .Net community-based implementation available.
0 -
Still no luck. The ping is still showing false.
Let me know if I am missing anything here.
0 -
Hi @pradeep.badoni,
Sorry, forgot to mention that you don't need to utilize the underlying WebSocket ping functionality. The protocol requires a specific PING request to be sent. When you review the "MarketPriceEdpGwServiceDiscoveryExample" example, you can see that 'Ping' messages are sent from the server and that you will need to respond with a 'Pong', i.e.
case "Ping":
SendMessage("{\"Type\":\"Pong\"}");
break;
default:
break;0 -
Thanks for the above suggestion, after removing the explicit Ping, i am able to connect the server, but get the below exception.
Note: i am not sending any log-in message we per the below comments in the examples:
/* Don't login -- the authentication token should do that for us. Just wait for the login refresh. */
let me know your thoughts.
0 -
WebSocketSharp-02022021102019.txt
Hi @nick.zincone,
I did enable the trace log and got the more detail on the error message detail (see attached).
Could you please help to find the issue. I am stuck here and not able to move forward.
Thanks
Pradeep B
0 -
Please remove WebSocket.SetCookie from the code.
From my test, there is no need to set cookies in the WebSocket connection.
0 -
Thanks for the above detail. I am successfully able to connect to the server and get the market data.
Need some more help.
I am building my new application using .NET Framework 3.5 and WebSocket-Sharp.
And while doing authentication, I am getting the below error message:
"Authentication failed because the remote party has closed the transport stream"
I am pretty much sure that this is related to "ServicePointManager.SecurityProtocol" and currently set like:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls
Could you please let me know what should be appropriate value for "ServicePointManager.SecurityProtocol".
Also, let me know if the above is not correct.
0 -
I got the answer for it and the issue got fix by adding the below code line:
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
0 -
Need help with new error message.
I am getting this error in the DicoveryServices() method. I didn't faced with issue in the past.
0 -
Hi @pradeep.badoni,
Could you possibly ask this question on a new thread? It helps drive the community by keeping questions separate and to help others if they run into the same issues.
thanks.
0 -
Noted Thanks...
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
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 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
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛