public override Stream RequestCaseData(CaseDataInfo caseDataInfo) { try { if (caseDataInfo.fileType.Equals(FileType.ManifestFile)) { string fileDirectory = m_CargoHostEndPoint.GetManifestDir(); FileStream stream = new FileStream(Path.Combine(fileDirectory, caseDataInfo.FileName), FileMode.Open); return(stream); } else if (caseDataInfo.fileType.Equals(FileType.FTIFile)) { FileStream stream = new FileStream(Path.Combine(m_TIPManagerComm.FTIImageDirectory, caseDataInfo.FileName), FileMode.Open); return(stream); } else { return(base.RequestCaseData(caseDataInfo)); } } catch (Exception exp) { throw new FaultException(new FaultReason(exp.Message)); } }
public virtual Stream RequestCaseData(CaseDataInfo caseDataInfo) { try { string caseDirectory = m_CaseList.GetCaseDirectory(caseDataInfo.CaseId); FileStream stream = new FileStream(caseDirectory + "\\" + caseDataInfo.FileName, FileMode.Open); OperationContext clientContext = OperationContext.Current; clientContext.OperationCompleted += new EventHandler(delegate(object sender, EventArgs e) { if (stream != null) { stream.Dispose(); } }); return(stream); } catch (Exception exp) { if (logger != null) { logger.PrintInfoLine("RequestCaseData exp: " + exp.Message); } throw new FaultException(new FaultReason(exp.Message)); } }
public Stream RequestFile(string sourceAlias, string caseId, string filename, FileType filetype) { CaseDataInfo caseDataInfo = new CaseDataInfo(caseId, filename, filetype); CaseSource <WSCommEndpoint> WSCommSource = FindSource <WSCommEndpoint>(sourceAlias); CaseSource <CaseRequestManagerEndpoint> ACSSource = FindSource <CaseRequestManagerEndpoint>(sourceAlias); if (default(CaseSource <WSCommEndpoint>) != WSCommSource) { try { return(WSCommSource.EndPoint.RequestCaseData(caseDataInfo)); } catch (FaultException ex) { throw; } catch (Exception ex) { WSCommSource.EndPoint.Abort(); if (m_SysConfigMgrAccess.Contains(WSCommSource.Alias)) { m_SysConfigMgrAccess.Delete(WSCommSource.Alias); } m_WSCommSources.RemoveSource(WSCommSource); throw; } } else if (default(CaseSource <CaseRequestManagerEndpoint>) != ACSSource) { try { return(ACSSource.EndPoint.RequestCaseData(caseDataInfo)); } catch (FaultException ex) { throw; } catch (Exception ex) { ACSSource.EndPoint.Abort(); if (m_SysConfigMgrAccess.Contains(ACSSource.Alias)) { m_SysConfigMgrAccess.Delete(ACSSource.Alias); } m_ACSSources.RemoveSource(ACSSource); throw; } } else { throw new Exception(ErrorMessages.SOURCE_NOT_AVAILABLE); } }
public Stream RequestCaseData(CaseDataInfo caseDataInfo) { return(base.Channel.RequestCaseData(caseDataInfo)); }