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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

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 512.0 KiB each and 1.0 MiB total.

Notice the default sample provided buy refinitiv does not work either. Same credentials works with python sample.
Upvote
Accepted
52.7k 135 44 63

@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 512.0 KiB each and 1.0 MiB total.

@thomas02

The code on GitHub has been updated.

Upvote
24.9k 86 10 22

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 512.0 KiB each and 1.0 MiB total.