question

Upvotes
Accepted
7 1 0 6

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[]>();
datastream-apidsws-api.net
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.

Upvote
Accepted
56k 145 45 65

@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.


1623769220890.png (68.5 KiB)
1623769746386.png (38.8 KiB)
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.

Upvotes
56k 145 45 65

image.png (29.1 KiB)
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.

Upvotes
7 1 0 6

I used fiddler as well, it uses http. Here is the screenshot

1623664417417.png

I am using ThomsonReuters.DswsApi.NET4.5.dll File Version 1.0.1.0

Are you using same dll?


1623664417417.png (2.9 KiB)
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.

Upvotes
39.3k 77 11 27

@vishal.kak

You need to change the protocol in the URL for Datastream Web Services endpoint in App.config file in your project. You may also need to add Security node to the XML with mode="Transport" attribute, as follows:

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
              <binding name="BasicHttpBinding_IDSService">
                <security mode="Transport" />
              </binding> 
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://product.datastream.com/DswsClient/V1/DSService.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDSService"
                contract="DSWSReference.IDSService" name="BasicHttpBinding_IDSService" />
        </client>
</system.serviceModel>

For more details see Getting Started chapter in DSWS Tutorial - Microsoft Visual Studio.

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.

Upvotes
39.3k 77 11 27

@vishal.kak

I just realized you mentioned that you use ThomsonReuters.DswsApi.NET4.5.dll, which I'm not familiar with. Where did you get it from?
My previous response assumed you were using Datastream Web Service WSDL, as described in DSWS Tutorial - Microsoft Visual Studio.

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.

Upvotes
56k 145 45 65

@vishal.kak

I am using Datastream.DswsApi.NET4.5.dll 1.1.1.0 available at http://product.datastream.com/DswsClient/Docs/Downloads.aspx.

1623722340674.png

I have tested it with the NET API + Samples (4.5).


1623722340674.png (21.7 KiB)
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.

Upvotes
7 1 0 6

@jirapongse.phuriphanvichai

I tested using Datastream.DswsApi.NET4.5.dll 1.1.1.0

I can still see http in fidder

Can you share/upload your test sample code so I could take a look


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.

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

Upvotes
7 1 0 6

@jirapongse.phuriphanvichai

Thanks, the latest version uses https instead of http.

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.