Ho to get Datastream .net DSClient.DataService.GetData to use https instead of http

I am using ThomsonReuters.DswsApi.NET4.5 dll to connect to data stream.

When I call DSClient.DataService.GetData method the dll internally uses “http://product.datastream.com/dswsclient/V1/DSService.svc”

We are getting firewall issues to using http endpoint and need to use https instead

Can you advise how I could ensure that datastream getData api call uses “https://product.datastream.com/DswsClient/V1/DSService.svc“

Is it possible to override?

Here is my code snippet

         DSClient.Options.UserName = “”;
         DSClient.Options.Password = “”;
         DSClient.Init();
 
         var datatype = "P";
         var request = new DSDataRequest()
         {
             Instrument = new DSInstrument(identifier),
             DataTypes = new DSDataTypes(datatype),
             Date = new DSTimeSeriesDate(DSDateType.Literal("-2Y"), DSDateType.Literal(""), DSDateFrequency.Daily),
         };
 
         var response = DSClient.DataService.GetData(request);
 
         double[] prices = response[datatype][identifier].GetValue<double[]>();

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @vishal.kak

    I used the same code shared in another question: https://community.developers.refinitiv.com/questions/79515/how-can-i-return-date-with-corresponding-value-whe.html.

    The fiddler output is:

    1623769220890.png

    In the DswsApiFor.NET4.5 package, the readme file mentions:

    Note. From December 2020 Datastream will be restricting Transport layer Security (TLS) to a minimum of version 1.2. 

    It also explains the options to support TLS 1.2. You may need to verify it.

    You may add the following configurations into the App.config file.

      <system.diagnostics>
        <trace autoflush="true"/>
        <sources>
          <source name="System.Net" maxdatasize="1024">
            <listeners>
              <add name="TraceFile"/>
            </listeners>
          </source>
          <source name="System.Net.Sockets" maxdatasize="1024">
            <listeners>
              <add name="TraceFile"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/>
        </sharedListeners>
        <switches>
          <add name="System.Net" value="Verbose"/>
          <add name="System.Net.Sockets" value="Verbose"/>
        </switches>
      </system.diagnostics>

    1623769746386.png

    The trace.log file will be created. We may be able to use this file to verify the problem.

Answers