当前位置:编程学习 > C#/ASP.NET >>

对于一个Java接口返回值Map,在.NET中应该有什么类型来接收?

  static void Main(string[] args)
        {
            CHessianProxyFactory factory = new CHessianProxyFactory();
            string url = "http://217.126.8.23:9999/abc/abc/abc";
            IService test = (IService)factory.Create(typeof(IService), url);
            Dictionary<string, object> dict = new Dictionary<string, object>();
            dict.Add("method", "getWarrantType");

            dict = test.callMethod(dict);//运行到这里就报返回具有无效的参数类型。 怎么解决?

        }
    }
    public interface IService
    {

        Dictionary<String, Object> callMethod(Dictionary<String, Object> map);//查询凭证类型
    }
    public class WarrantType
    {
        decimal warrantTypeId;
        string warrantTypeCode = string.Empty;
        string warrantTypeName = string.Empty;
        decimal sortRank;
        string status = string.Empty;
        decimal operators;
        DateTime opTime;
    }



对方的Java接口说明:
public Map<String ,Object>  callMethod (Map<String ,Object> map)
创建HashMap<String,Object>的实例
必须包含的键值对:
[key:“method”, value:”getWarrantType”]
返回值:map
[key:“result”, value:List<WarrantType>]  WarrantType参见实体类
.net java dictionary hashmap --------------------编程问答-------------------- 有没有高手帮帮我? --------------------编程问答-------------------- Dictionary --------------------编程问答-------------------- 还用Map类型接收啊! --------------------编程问答-------------------- 可是这个.NET中根本就没有Map这个对象。 --------------------编程问答-------------------- 还有用Dictionary来接收,我都已经做了,我问的是为什么返回类型无效?Dictionary<string, object> dict = new Dictionary<string, object>();
            dict.Add("method", "getWarrantType");

            dict = test.callMethod(dict);// --------------------编程问答-------------------- http://momy.blogbus.com/logs/40398609.html
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,