private void CloseResponseXml(ref XmlWriter xmlWriter, ref StringWriter strWriter, ref XmlDocument xmlResponse) { m_connectorInc.Close_ResponseXML(ref xmlWriter); xmlWriter.Flush(); xmlWriter.Close(); xmlResponse.LoadXml(strWriter.ToString()); }
/// <summary> /// Processes exception catch for other methods /// </summary> /// <param name="ex">Exception that occurred</param> /// <param name="methodName">Name of the method where the exception occurred</param> /// <param name="xmlWriter">XmlWriter from the method where the exception occurred</param> /// <param name="strWriter">StringWriter from the method where the exception occurred</param> private void ProcessException(Exception ex, string methodName, XmlWriter xmlWriter, StringWriter strWriter) { m_connectorInc.Init_ResponseXML(methodName, ref strWriter, ref xmlWriter); if (ex is CMSException) { var statusCode = CMSException.StatusCodes.GENERAL_ERROR; if (ex.Data != null) { statusCode = (CMSException.StatusCodes)ex.Data["StatusCode"]; } GenerateStatusXml(xmlWriter, methodName, statusCode, ex.Message); } else { m_errHandler.ProcessError(ex); GenerateStatusXml(xmlWriter, methodName, CMSException.StatusCodes.APPLICATION_EXCEPTION, m_phraseLib.Lookup("term.errorprocessingseelog")); m_logger.WriteError("An error occurred while processing - please see the error log!"); } m_connectorInc.Close_ResponseXML(ref xmlWriter); }