public List <string> GetTaskVideosURLs(long taskId) { STCTFMService.TFMServiceClient client = new STCTFMService.TFMServiceClient(); var output = client.GetTaskVideosURLs(taskId); if (output != null) { return(output.ToList()); } return(null); }
public List <string> GetTaskVideosURLsTest(long taskId) { var res = new List <string>(); STCTFMService.TFMServiceClient client = new STCTFMService.TFMServiceClient(); var output = client.GetTaskVideosURLs(taskId); if (output != null) { var index = 0; var folderPath = string.Format(@"{0}\Videos\{1}", Utility.GetExecutionPath(), taskId); if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } foreach (var str in output) { index++; //var videoStream = new MemoryStream(Convert.FromBase64String(str)); var videoBytes = Convert.FromBase64String(str); var path = string.Format(@"{0}\{1}.wmv", folderPath, index); if (!File.Exists(path)) { File.WriteAllBytes(path, videoBytes); } //var vPath = OperationContext.Current.IncomingMessageHeaders.To.ToString().Replace("TFMIntegrationService.svc","") + string.Format("Videos/{0}/{1}.wmv", taskId, index); var vPath = HttpContext.Current.Request.Url.AbsoluteUri.Replace("TFMIntegrationService.svc", "") + string.Format("Videos/{0}/{1}.wmv", taskId, index); res.Add(vPath); } return(res); } return(null); }