Ejemplo n.º 1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetInvalidationResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Invalidation", targetDepth))
                    {
                        response.Invalidation = InvalidationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }



            return;
        }
        public CreateInvalidationResult Unmarshall(XmlUnmarshallerContext context)
        {
            CreateInvalidationResult createInvalidationResult = new CreateInvalidationResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Invalidation", targetDepth))
                    {
                        createInvalidationResult.Invalidation = InvalidationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(createInvalidationResult);
                }
            }


            createInvalidationResult.Location = context.Headers["Location"];


            return(createInvalidationResult);
        }
Ejemplo n.º 3
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateInvalidationResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Invalidation", targetDepth))
                    {
                        response.Invalidation = InvalidationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }


            IWebResponseData responseData = context.ResponseData;

            if (responseData.IsHeaderPresent("Location"))
            {
                response.Location = responseData.GetHeaderValue("Location");
            }


            return;
        }