public static QueryTopicReverseRouteTableResponse Unmarshall(UnmarshallerContext _ctx)
        {
            QueryTopicReverseRouteTableResponse queryTopicReverseRouteTableResponse = new QueryTopicReverseRouteTableResponse();

            queryTopicReverseRouteTableResponse.HttpResponse = _ctx.HttpResponse;
            queryTopicReverseRouteTableResponse.RequestId    = _ctx.StringValue("QueryTopicReverseRouteTable.RequestId");
            queryTopicReverseRouteTableResponse.Success      = _ctx.BooleanValue("QueryTopicReverseRouteTable.Success");
            queryTopicReverseRouteTableResponse.Code         = _ctx.StringValue("QueryTopicReverseRouteTable.Code");
            queryTopicReverseRouteTableResponse.ErrorMessage = _ctx.StringValue("QueryTopicReverseRouteTable.ErrorMessage");

            List <Dictionary <string, string> > queryTopicReverseRouteTableResponse_srcTopics = new List <Dictionary <string, string> >();

            for (int i = 0; i < _ctx.Length("QueryTopicReverseRouteTable.SrcTopics.Length"); i++)
            {
                Dictionary <string, string> tmp = new Dictionary <string, string>()
                {
                };
                foreach (var _item in _ctx.ResponseDictionary)
                {
                    string prefix = "QueryTopicReverseRouteTable.SrcTopics[" + i + "].";
                    if (_item.Key.IndexOf(prefix) == 0)
                    {
                        tmp.Add(_item.Key.Substring(prefix.Length), _item.Value);
                    }
                }
                if (tmp.Count > 0)
                {
                    queryTopicReverseRouteTableResponse_srcTopics.Add(tmp);
                }
            }
            queryTopicReverseRouteTableResponse.SrcTopics = queryTopicReverseRouteTableResponse_srcTopics;

            return(queryTopicReverseRouteTableResponse);
        }
Exemple #2
0
        //获取某一topic的源Topic,即反向路由
        public void TestQueryTopicReverseRouteTable()
        {
            DefaultAcsClient acsClient = Demo.IotClient.GetClient();
            String           DstTopic  = "/<productKey>/device_0821_148/user/update";

            QueryTopicReverseRouteTableRequest request = new QueryTopicReverseRouteTableRequest();

            request.Topic = DstTopic;

            QueryTopicReverseRouteTableResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine("Query Topic Reverse Route Table: " + response.Success);
            if (!(bool)response.Success)
            {
                Console.WriteLine(response.Code + ", " + response.ErrorMessage);
                Console.ReadKey();
                return;
            }

            List <String> SrcTopics = response.SrcTopics;

            for (int i = 0; i < SrcTopics.Count; i += 1)
            {
                Console.WriteLine("SrcTopic: " + SrcTopics[i]);
            }
        }
Exemple #3
0
        public static QueryTopicReverseRouteTableResponse Unmarshall(UnmarshallerContext context)
        {
            QueryTopicReverseRouteTableResponse queryTopicReverseRouteTableResponse = new QueryTopicReverseRouteTableResponse();

            queryTopicReverseRouteTableResponse.HttpResponse = context.HttpResponse;
            queryTopicReverseRouteTableResponse.RequestId    = context.StringValue("QueryTopicReverseRouteTable.RequestId");
            queryTopicReverseRouteTableResponse.Success      = context.BooleanValue("QueryTopicReverseRouteTable.Success");
            queryTopicReverseRouteTableResponse.ErrorMessage = context.StringValue("QueryTopicReverseRouteTable.ErrorMessage");

            List <string> queryTopicReverseRouteTableResponse_srcTopics = new List <string>();

            for (int i = 0; i < context.Length("QueryTopicReverseRouteTable.SrcTopics.Length"); i++)
            {
                queryTopicReverseRouteTableResponse_srcTopics.Add(context.StringValue("QueryTopicReverseRouteTable.SrcTopics[" + i + "]"));
            }
            queryTopicReverseRouteTableResponse.SrcTopics = queryTopicReverseRouteTableResponse_srcTopics;

            return(queryTopicReverseRouteTableResponse);
        }