Hi all,
I'm working on a CodeActivity for Microsoft Dynamics 365 Version 1612 (9.0.2.3034) (DB 9.0.2.3034) on-premises.
I am trying to call an API but It gives an "Unable to connect to the remote server" error. The code I wrote for that works fine in a console application, but it fails in the plugin. The code looks like the following: I am using .Net Framework 4.5.2.
string URL = "xxxxxx.xxxx.it/.../xxx
System.Net.WebClient webClient = new System.Net.WebClient();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
webClient.Headers.Add("Authorization", "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
var result = webClient.DownloadString(URL);
Can you guys help me?