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[]>();
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:
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>
The trace.log file will be created. We may be able to use this file to verify the problem.
How do you verify that the library uses http://product.datastream.com/dswsclient/V1/DSService.svc instead of https://product.datastream.com/DswsClient/V1/DSService.svc?
I ran the application with Fiddler and found that it uses https://product.datastream.com/DswsClient/V1/DSService.svc.
I used fiddler as well, it uses http. Here is the screenshot
I am using ThomsonReuters.DswsApi.NET4.5.dll File Version 1.0.1.0
Are you using same dll?
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.
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.
I am using Datastream.DswsApi.NET4.5.dll 1.1.1.0 available at http://product.datastream.com/DswsClient/Docs/Downloads.aspx.
I have tested it with the NET API + Samples (4.5).
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
I got ThomsonReuters.DswsApi.NET4.5.dll from http://product.datastream.com/DswsClient/Docs/Downloads.aspx