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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 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.

@thomas02

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvote
Accepted
78.8k 250 52 74

@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
25.3k 87 12 25

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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