Example #1
0
        public ResultsetFormatter ReadDiscoverResponse(XmlReader reader, InlineErrorHandlingType inlineErrorHandling, DataTable inTable, bool schemaOnly, Dictionary <string, bool> columnsToConvertTimeFor)
        {
            ResultsetFormatter result;

            try
            {
                ResultsetFormatter resultsetFormatter = SoapFormatter.ReadDiscoverResponsePrivate(reader, inlineErrorHandling, inTable, schemaOnly, columnsToConvertTimeFor);
                result = resultsetFormatter;
            }
            catch (XmlException innerException)
            {
                throw new AdomdUnknownResponseException(XmlaSR.UnknownServerResponseFormat, innerException);
            }
            catch (IOException innerException2)
            {
                if (this.client != null)
                {
                    this.client.Disconnect(false);
                }
                throw new AdomdConnectionException(XmlaSR.ConnectionBroken, innerException2);
            }
            catch (AdomdUnknownResponseException)
            {
                throw;
            }
            catch (XmlaException)
            {
                throw;
            }
            catch
            {
                if (this.client != null)
                {
                    this.client.Disconnect(false);
                }
                throw;
            }
            finally
            {
                this.EndReceival(reader);
            }
            return(result);
        }
Example #2
0
        public ResultsetFormatter ReadResponse(XmlReader reader, InlineErrorHandlingType inlineErrorHandling)
        {
            ResultsetFormatter result;

            try
            {
                ResultsetFormatter resultsetFormatter = null;
                if (XmlaClient.IsExecuteResponseS(reader))
                {
                    resultsetFormatter = SoapFormatter.ReadExecuteResponsePrivate(reader, inlineErrorHandling);
                }
                else if (XmlaClient.IsDiscoverResponseS(reader))
                {
                    resultsetFormatter = SoapFormatter.ReadDiscoverResponsePrivate(reader, inlineErrorHandling, null, false, null);
                }
                else
                {
                    if (!XmlaClient.IsEmptyResultS(reader))
                    {
                        throw new AdomdUnknownResponseException(XmlaSR.UnknownServerResponseFormat, string.Format(CultureInfo.InvariantCulture, "Expected execute or discover response, or empty result, got {0}", new object[]
                        {
                            reader.Name
                        }));
                    }
                    XmlaClient.ReadEmptyRootS(reader);
                }
                result = resultsetFormatter;
            }
            catch (XmlException innerException)
            {
                throw new AdomdUnknownResponseException(XmlaSR.UnknownServerResponseFormat, innerException);
            }
            catch (IOException innerException2)
            {
                if (this.client != null)
                {
                    this.client.Disconnect(false);
                }
                throw new AdomdConnectionException(XmlaSR.ConnectionBroken, innerException2);
            }
            catch (AdomdUnknownResponseException)
            {
                throw;
            }
            catch (XmlaException)
            {
                throw;
            }
            catch
            {
                if (this.client != null)
                {
                    this.client.Disconnect(false);
                }
                throw;
            }
            finally
            {
                this.EndReceival(reader);
            }
            return(result);
        }