Beispiel #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateVpnConnectionResponse response = new CreateVpnConnectionResponse();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth = 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("vpnConnection", targetDepth))
                    {
                        var unmarshaller = VpnConnectionUnmarshaller.Instance;
                        response.VpnConnection = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return(response);
        }
        public static CreateVpnConnectionResponse Unmarshall(UnmarshallerContext context)
        {
            CreateVpnConnectionResponse createVpnConnectionResponse = new CreateVpnConnectionResponse();

            createVpnConnectionResponse.HttpResponse    = context.HttpResponse;
            createVpnConnectionResponse.RequestId       = context.StringValue("CreateVpnConnection.RequestId");
            createVpnConnectionResponse.VpnConnectionId = context.StringValue("CreateVpnConnection.VpnConnectionId");
            createVpnConnectionResponse.Name            = context.StringValue("CreateVpnConnection.Name");
            createVpnConnectionResponse.CreateTime      = context.LongValue("CreateVpnConnection.CreateTime");

            return(createVpnConnectionResponse);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateVpnConnectionResponse response = new CreateVpnConnectionResponse();

            int targetDepth = 2;

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

                        continue;
                    }
                }
            }


            return(response);
        }