WebSocket-Sharp - Issue in DiscoverServices() method from the MarketPriceEdpGwServiceDiscoveryExa...

...mple
Hi Team,
Need your help.
I am building my new application using .NET Framework 3.5 and WebSocket-Sharp.
I am getting this error in the DicoveryServices() method (The referenced code is used from "MarketPriceEdpGwServiceDiscoveryExample").
Note: I didn't faced this issue in the past while working with the same code in .NET Framework 4.5.
Best Answer
-
Hi @pradeep.badoni,
I was able to replicate the issue with Json 3.5.8. This is the oldest (first release of the package - about 10 years old). I believe what is happening is there is a conflict between this old version of NewtonSoft Json package and the WebRequest interfaces. It appears NewtonSoft came out with a couple of releases very quickly addressing this issue.
To resolve this, you will have to upgrade to NewSoft Json 4.0.2 - it only came out a couple of months later. Did you try a newer version yet?
thanks.
0
Answers
-
Hi @pradeep.badoni,
Is there a requirement to use such an old version of .Net? The .Net community has pretty much stopped releases for .Net framework and have been focussing on .Net Core and now how moved to .Net 5 and beyond. The latest, Microsoft supported version of .Net is 4.5.2.
0 -
Hi @pradeep.badoni,
Have you considered using the .Net libraries I recommended, i.e. https://developers.refinitiv.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-platform-libraries? These libraries are specifically designed to do all the heavy lifting of interfacing with streaming, as well as, other data services within RDP. With only a few lines of code, you can stream your content and focus on your specific business requirements instead.
0 -
We have few client's at .NET Framework 3.5 which we need to support and they don't have any plan to upgrade to the higher version soon.
Let me know if you need more detail here.
0 -
Hi @pradeep.badoni,
I would consider making the client aware of the support for .Net framework 3.5. That being said, assuming they need to move forward now, now that it appears you are able to stream using WebSocketSharp, did you try building the "MarketPriceEdpGwServiceDiscoveryExample" example with .Net Framework 3.5? I don't think it is the intention of the development group to support versions of .Net that aren't supported by Microsoft. Let me know what the result is there to confirm.
0 -
I am getting this issue when debugging the "MarketPriceEdpGwServiceDiscoveryExample" example with .Net Framework 3.5 using WebSocketSharp.
The Authentication works fine and getting issue while Discovering the Service.
Is there any way to fix this error?
0 -
I didn't get chance to look into the .NET Libraries as I was focusing to work with WebSocket API either using inbuilt .NET WebSocket feature or using WebSocket-Sharp.
Do we have any examples of these .NET Library?
Can we use these .NET Library to connect to WebSocket API server?
0 -
Hi @pradeep.badoni,
I know you are getting this issue when building with .Net Framework 3.5 using WebSocketSharp. The issue could be with .Net Framework 3.5. Because Microsoft is no longer supporting this old framework, we can't rely on Microsoft to fix it if the error may be within their libraries.
Did you try running the native "MarketPriceEdpGwServiceDiscoveryExample", using .Net Framework 3.5 (NOT using WebSocketSharp, but the actual native example which includes the .Net WebSocket implementation).
I just want to be sure this is related to changes in the .Net Framework.
0 -
The "MarketPriceEdpGwServiceDiscoveryExample", using .Net Framework 3.5 can't be run without using WebSocketSharp as the inbuild feature of WebSockets in .NET is only available from .NET Framework 4.5
0 -
Hi @pradeep.badoni,
Ok. Based on the code segment you provided, it does work with .Net Framework 4.5 - I tested. However, there may be some nuances (or issues) with .Net Framework 3.5. If there are issues, there may be workarounds or it may be some setting in 3.5 that you need to apply.
What I would suggest at this point is to see if there are any known changes in 3.5 vs 4.5 with HttpWebRequest - I couldn't find anything at first glance. Also, you can try to see if the Real Time team may be able to help. You can submit your question to the Real-Time issues section (https://github.com/Refinitiv/Real-Time-SDK/issues) and make mention you are using their sample but with .Net Framework 3.5.
0 -
Hi @pradeep.badoni,
The link I provided lists numerous examples of using the library. In particular, there are examples to retrieve streaming data (https://github.com/Refinitiv-API-Samples/Example.RDPLibrary.DotNet/tree/master/src/2.%20Content/2.2-Pricing) - they connect to the WebSocket server. The library provides default WebSocket implementations but also allows developers to register their own WebSocket implementation (https://github.com/Refinitiv-API-Samples/Example.RDPLibrary.DotNet/tree/master/src/3.%20Delivery/3.0-Core/3.0.03-Core-WebSocket). For example, you can see I'm using the WebSocketSharp to register within the library. Just navigate down into the project.
The libraries support .Net Framework 4.52 and .Net Standard 2.0. With this, application developers can target .Net Framework applications as well as .Net Core and .Net 5 applications - all of the modern implementations.
0 -
0
-
As suggested I did created ticket in the Real-Time-SDK forum https://github.com/Refinitiv/Real-Time-SDK/issues/167
but looks like it will take more time.
Do we have any other alternative way to speed up the process related to this issue?
Appreciated your help on this.
Thanks
Pradeep B
0 -
Other then DiscoverServices() method issue, I am able finally able to run the code in .NET 3.5 and able to fetch the market data.
For now in the test program I have hardcoded the market data streaming server and move forward.
If i can get more help on DiscoverServices() issue that would be much appreciated.
0 -
I think I found something interesting here.
Looks like in the DiscoverServices() method, we have some dependency with the JSON dll used in the sample example.
Today, I have created a new C# project taking the code provided in the "MarketPriceEdpGwServiceDiscoveryExample" in VS2013 with .NET framework 4.5 and I have used a older version of "Newtonsoft.Json.dll" (the version is 4.0.0.0)
And I can see the same issue with DiscoverServices() method.
When I changed the "Newtonsoft.Json.dll" to the higher version (provided in the sample example it self - the version is 12.0.1.22628) it worked fine without any issue.
Open Questions:
Is there any dependency on the "Newtonsoft.Json.dll" version?
Why DiscoverServices() method is breaking when the "Newtonsoft.Json.dll" version is lower? In this method we are just using HttpWebRequest not more then that.
Do we need to use "Newtonsoft.Json.dll" 12.0.1.22628 version only? My initial thought was we should be good to use any version of "Newtonsoft.Json.dll".
Let me know your thoughts.
0 -
Could you please share your thoughts on the above?
0 -
Hi @pradeep.badoni,
When you submit a request to discover the endpoint services, it is not using Json at all. BTW, I looked to see if I could replicate what you observed with an older version of json.net, and there is no such version: 4.0.0.0.
0 -
This is what I am using in my .NET 4.5 project with inbuild .NET WebSocket feature and in the Visual studio it does say that the Version is 4.0.0.0.
0 -
Hi @pradeep.badoni,
Can you please provide me the NuGet version. Thanks.
0 -
Newtonsoft.Json dll Version:
4.5 .NET Framework Program
I am not sure about the NuGet version of the Newtonsoft.Json dll as I just referenced it from our 3rdParty DLL collection (used by all the application in our software).
3.5 .NET Framework Program
Below is the version used.
Install-Package Newtonsoft.Json -Version 3.5.8
Let me know if you need more detail.
0 -
Not yet, I can try with 4.0.2.
What about the 4.5 Framework program? I believe the NewSoft Json version is higher then 3.5.8.
Let me know your thoughts.
0 -
Hi @pradeep.badoni,
What do you want to know about the 4.5 Framework? Yes, it uses a new version of the Json package, but simply change the version. That is what I did. I started off with whatever it was - tested and it worked. I then switched to 3.5.8 and it failed. I then tried a few more to figure out which one seemed to help and it was 4.0.2. Just update your example to the latest possible one for your project.
0 -
Thanks for your input here.
I am able to run both .NET Framework 4.5 (inbuild WebSocket in .NET) and .NET 3.5 Framework with open source WebSocketSharp.
Thanks a lot for your help on this ticket.
Appreciated...
I think we we can close this ticket.
Thanks
Pradeep B
0 -
That's great to hear. Just click Accept for the answer that provided you the answer.
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
- 684 Datastream
- 1.4K DSS
- 614 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
- 248 ETA
- 552 WebSocket API
- 37 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
- 641 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 89 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛