question

Upvotes
Accepted
1 1 1 2

How can I use proxy settings on ExtractionsContext C# examples

I'm trying to get field list for TickHistoryTimeAndSales report using below proxy settings. It does not seem to be working. Could you please tell me how to use the proxy setting in the QickStart C# examples?

var ExtractionsContext = new ExtractionsContext(new Uri("https://hosted.datascopeapi.reuters.com/RestApi/v1/"), "UserName", "Password");

var proxy = new WebProxy("http://MyProxy:Port", true);

var credentials = new NetworkCredential("UserName", "Password"); ExtractionsContext.Options.UseProxy = true;

ExtractionsContext.Options.Proxy = proxy;

ExtractionsContext.Options.Proxy.Credentials = credentials;

var availableFields = ExtractionsContext.GetValidContentFieldTypes(ReportTemplateTypes.TickHistoryTimeAndSales);

tick-history-rest-apic#proxy
icon clock
10 |1500

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

It is okay if I only set proxy without NetworkCredential.

However, if I set NetworkCredential, it will not work. I will investigate this issue and keep you posted.

Upvotes
Accepted
38.1k 71 35 53

DSS .NET SDK version 11.3 is available. From my test, it supports proxy with Network Credential. You can download it from here.

The code is:

ExtractionsContext extractionsContext =
                 new ExtractionsContext(dssUri, dssUserName, dssUserPassword);

WebProxy proxy = new WebProxy("http://proxy:port/", true);
proxy.Credentials = new NetworkCredential("proxyuser", "proxypassword");
extractionsContext.Options.Proxy = proxy;
extractionsContext.Options.UseProxy = true;
icon clock
10 |1500

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

Upvotes
16 0 0 5
icon clock
10 |1500

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

Click below to post an Idea Post Idea