Exemple #1
0
        private Response DeserializeResponseXml(Request request, TextReader reader, Type bodyType)
        {
            var context = new ResponseDeserializationContext {
                BodyType = bodyType
            };

            var response = (Response)Serializer.Deserialize(reader, typeof(Response), context);

            response.Request = request;

            NotifyReceived(response);

            return(response);
        }
        private void ReadBody(XmlReader reader)
        {
            var hvReader = reader as HealthVaultXmlReader;
            ResponseDeserializationContext context = null;

            if (hvReader != null)
            {
                context = hvReader.Context as ResponseDeserializationContext;
            }

            if (context == null || context.BodyType == null)
            {
                Body = reader.ReadOuterXml();
            }
            else
            {
                hvReader.RootElementName = context.BodyType.Name;
                Body = HealthVaultClient.Serializer.Deserialize(reader, context.BodyType);
            }
        }
        private Response DeserializeResponseXml(Request request, TextReader reader, Type bodyType)
        {
            var context = new ResponseDeserializationContext {BodyType = bodyType};

            var response = (Response) Serializer.Deserialize(reader, typeof (Response), context);
            response.Request = request;

            NotifyReceived(response);

            return response;
        }