For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

C# stopped working

Hi All,

We have a job running that has stopped working. Our discovery services calls returns a content length of -1.

       public static bool DiscoverServices(string url = null)
        {
            if (string.IsNullOrEmpty(url))
                url = _discoveryUrl;


            string param_url = url + "?transport=websocket";


            //Console.WriteLine("Sending service discovery request to {0}\n", param_url);
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(param_url);
            webRequest.Headers.Add("Authorization", "Bearer " + _authToken);
            webRequest.AllowAutoRedirect = false;
            webRequest.UserAgent = "CSharpMarketPriceEdpGwServiceDiscoveryExample";
            try
            {
                HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();


                if (webResponse.ContentLength > 0)

We get a fine token however webResponse.ContentLength has started returning -1. Any pointers what could cause this?

websocketsrrtorefinitiv-realtime-optimised
icon clock
10 |1500

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

Notice the default sample provided buy refinitiv does not work either. Same credentials works with python sample.
Upvote
Accepted
38.1k 69 35 53

@thomas02

It looks similar to the question in this thread.

icon clock
10 |1500

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

@thomas02

The code on GitHub has been updated.

Upvote
20.3k 73 10 20

Hi @thomas02

If you are using deriving your code from the GitHub example, please note that as well as the above chunking fix - there was another minor fix (a wrongly placed return true / missing return false statements). So,please ensure these are also applied to any code that is derived from the GitHub example.


icon clock
10 |1500

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

Click below to post an Idea Post Idea