public Stream PutFile(Stream input) { //this.OnEntry(); ServiceHelper.Instance.LogOn("xxx", "CD2EB0837C9B4C962C22D2FF8B5441B7B45805887F051D39BF133B583BAF6860", "pl"); SessionManager.OneTimeSession = true; Stream outputStream = null; try { var uploadedDocument = repository.AddMultipleFiles(input); var response = XDocument.Parse("<response />"); foreach (var doc in uploadedDocument) { response.Root.Add(new XElement("file", new XAttribute("oldFilename", doc.FileName), new XAttribute("newFilename", doc.FileIdentifier))); } outputStream = new MemoryStream(Encoding.UTF8.GetBytes(response.ToString(SaveOptions.DisableFormatting))); } catch (Exception ex) { RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:609"); ServiceHelper.Instance.OnException(ex); } finally { ServiceHelper.Instance.OnExit(); } WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; return(outputStream); }