Hi All,
I'm consuming the WebAPI from SSIS Packages so i have written the following code in the ScriptTask and my intention is it should to wait for the response (i.e. it will just call the endpoint and continue the process)
var webClient = new System.Net.WebClient();
webClient.Headers.Add("abc", "xyz");
webClient.Headers.Add("abc1", "xyz1");
File.AppendAllLines("FilePath\\Log.txt", new string[] { string.Format("{0} EP Calling Started: {1}", DateTime.Now, BatchID) });
System.Collections.Specialized.NameValueCollection formData = new System.Collections.Specialized.NameValueCollection();
formData["test"] = "test";
webClient.UploadValuesAsync(new Uri(webAddr), "Post", formData);
File.AppendAllLines("FilePath\\Log.txt",, new string[] { string.Format("{0} EP Calling ended: {1}", DateTime.Now, BatchID) });
Sometimes WebClient is not hitting the endpoint. to confirm that I have placed text file logging in Script Task and endpoint. endpoint calling is happening from packages but it is not hitting the endpoint in logs i found this
when WebClient is not hitting the endpoint. following info is logged into the file
From Script Task:
6/1/2017 1:10:03 PM EP Calling Started: 33962
6/1/2017 1:10:03 PM EP Calling ended: 33962
if it is success log will be like this
From Script Task:
6/1/2017 1:10:03 PM EP Calling Started: 33962
6/1/2017 1:10:03 PM EP Calling ended: 33962
From endPoint:
6/1/2017 1:10:04 PM EP Started: 33962
6/1/2017 1:10:58 PM EP ended: 33962
can you please let me know what is the root cause of the issue?
What I have tried:
var webClient = new System.Net.WebClient();
webClient.Headers.Add("abc", "xyz");
webClient.Headers.Add("abc1", "xyz1");
File.AppendAllLines("FilePath\\Log.txt", new string[] { string.Format("{0} EP Calling Started: {1}", DateTime.Now, BatchID) });
System.Collections.Specialized.NameValueCollection formData = new System.Collections.Specialized.NameValueCollection();
formData["test"] = "test";
webClient.UploadValuesAsync(new Uri(webAddr), "Post", formData);
File.AppendAllLines("FilePath\\Log.txt",, new string[] { string.Format("{0} EP Calling ended: {1}", DateTime.Now, BatchID) });