예제 #1
0
 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));
     }
 }
예제 #2
0
        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));
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 public Stream RequestCaseData(CaseDataInfo caseDataInfo)
 {
     return(base.Channel.RequestCaseData(caseDataInfo));
 }