/**
         *  Determine a file name from the response interaction id and the original request message id, and write the received
         *  message to it.
         */
        public void handle(SpineSOAPRequest s)
        {
            StringBuilder sb = new StringBuilder(spoolDirectory);
            sb.Append("\\");
            sb.Append(getLastServiceURIElement(s.SoapAction));
            sb.Append("_");
            sb.Append(getFileSafeMessageID(s.getMessageId()));
            sb.Append(".message");
            string filename = sb.ToString();

            try
            {
                using (FileStream fs = new FileStream(filename, FileMode.Create))
                {
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.Write(s.SyncronousResponse);
                        sw.Flush();
                        sw.Close();
                    }
                }
            }
            catch (Exception e)
            {
                EventLog ev = new EventLog("Application");
                ev.Source = LOGSOURCE;
                StringBuilder sbe = new StringBuilder("Failed to save response ");
                sbe.Append(s.getMessageId());
                sbe.Append(" service ");
                sbe.Append(s.SoapAction);
                sbe.Append(". Reason: ");
                sbe.Append(e.ToString());
                ev.WriteEntry(sbe.ToString(), EventLogEntryType.Error);
            }
        }
コード例 #2
0
        /**
         *  Determine a file name from the response interaction id and the original request message id, and write the received
         *  message to it.
         */
        public void handle(SpineSOAPRequest s)
        {
            StringBuilder sb = new StringBuilder(spoolDirectory);

            sb.Append("\\");
            sb.Append(getLastServiceURIElement(s.SoapAction));
            sb.Append("_");
            sb.Append(getFileSafeMessageID(s.getMessageId()));
            sb.Append(".message");
            string filename = sb.ToString();

            try
            {
                using (FileStream fs = new FileStream(filename, FileMode.Create))
                {
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.Write(s.SyncronousResponse);
                        sw.Flush();
                        sw.Close();
                    }
                }
            }
            catch (Exception e)
            {
                EventLog ev = new EventLog("Application");
                ev.Source = LOGSOURCE;
                StringBuilder sbe = new StringBuilder("Failed to save response ");
                sbe.Append(s.getMessageId());
                sbe.Append(" service ");
                sbe.Append(s.SoapAction);
                sbe.Append(". Reason: ");
                sbe.Append(e.ToString());
                ev.WriteEntry(sbe.ToString(), EventLogEntryType.Error);
            }
        }
 public void handle(SpineSOAPRequest r)
 {
 }
コード例 #4
0
 public void handle(SpineSOAPRequest r)
 {
 }