/// <summary>
        /// Reads the response.
        /// </summary>
        /// <param name="ewsXmlReader">The XML reader.</param>
        /// <param name="responseHeaders">HTTP response headers</param>
        /// <returns>Service response.</returns>
        protected async Task <object> ReadResponseAsync(EwsServiceXmlReader ewsXmlReader, WebHeaderCollection responseHeaders, CancellationToken token)
        {
            object serviceResponse;

            await this.ReadPreambleAsync(ewsXmlReader, token);

            await ewsXmlReader.ReadStartElementAsync(XmlNamespace.Soap, XmlElementNames.SOAPEnvelopeElementName, token);

            await this.ReadSoapHeaderAsync(ewsXmlReader, token);

            await ewsXmlReader.ReadStartElementAsync(XmlNamespace.Soap, XmlElementNames.SOAPBodyElementName, token);

            await ewsXmlReader.ReadStartElementAsync(XmlNamespace.Messages, this.GetResponseXmlElementName(), token);

            if (responseHeaders != null)
            {
                serviceResponse = this.ParseResponse(ewsXmlReader, responseHeaders);
            }
            else
            {
                serviceResponse = this.ParseResponse(ewsXmlReader);
            }

            ewsXmlReader.ReadEndElementIfNecessary(XmlNamespace.Messages, this.GetResponseXmlElementName());

            await ewsXmlReader.ReadEndElementAsync(XmlNamespace.Soap, XmlElementNames.SOAPBodyElementName, token);

            await ewsXmlReader.ReadEndElementAsync(XmlNamespace.Soap, XmlElementNames.SOAPEnvelopeElementName, token);

            return(serviceResponse);
        }